EVALUATION
After further discussion, it is clear that ImageReaders should be allowed
to call ImageInputStream.flushBefore() as part of the decoding process ("if
ImageReaders are not allowed to call it, who is?" says one of the original
designers of the API). So it seems that applications should not assume that
a marked position will remain valid after a call to one of the ImageReader
methods. I suppose we could close this as "not a bug", but we should probably
update the documentation somewhere (mark()?) so that developers are not
surprised if they stumble across this behavior in the future.
|
EVALUATION
This is blocking some performance test development, so it should be investigated
sooner rather than later. The ImageInputStream.flushBefore() method was
created for a valid reason, but the original authors probably did not consider
the case mentioned in this bug report. We could remove the flushBefore()
calls from the PNGImageReader, and that would solve the problem, but it
doesn't prevent other plugins from using the flushBefore() method and causing
similar problems for application code. I'm not sure if there's a good solution
here.
|