[OpenJDK 2D-Dev] [9] RFR JDK-4924727 : reader.abort() method does not work when called inside imageStarted for PNG

Jayathirth D V jayathirth.d.v at oracle.com
Thu Aug 11 18:59:16 UTC 2016


Hi,

 

Please review the following fix in JDK9 at your convenience:

 

Bug : https://bugs.openjdk.java.net/browse/JDK-4924727 

 

Webrev : http://cr.openjdk.java.net/~jdv/4924727/webrev.00/ 

 

Issue : When we issue ImageReader.abort() in IIOReadProgressListener.imageStarted(), reading is not aborted and it is continued.

 

Root cause : After IIOReadProgressListener.imageStarted() call in PNGImageReader.java when we enter decodeImage() we call clearAbortRequest() which will clear the abort request from IIOReadProgressListener.imageStarted().

 

Solution : clearAbortRequest() documentation mentions that it should be called before reading of image starts, so it should be called before IIOReadProgressListener.imageStarted()(In PNGImageReader.java it is processImageStarted(0) in readImage()). So moved clearAbortRequest() call from decodeImage() to readImage(). Also we should call abortRequested() in PNGImageReader.java at places mapping to IIOReadProgressListener and not randomly at end of functions or at places related to IIOReadUpdateListener, updated the code for the same.

 

 

Observation not related to this issue : We don't have call similar to IIOReadProgressListener.readAborted() in IIOReadUpdateListener, but user can call ImageReader.abort() from IIOReadUpdateListener methods. Is there a need to add similar method in IIOReadUpdateListener? Any inputs on this also would be helpful.

 

Thanks,

Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20160811/f0d849fb/attachment.html>


More information about the 2d-dev mailing list