Skip to main content

No appropriate reader for Progressive JPEG.

2 replies [Last post]
qwertywin
Offline
Joined: 2006-05-03
Points: 0

So I have this CMYK JPEG

http://staging.vfmii.com/medlib/cdms_photo/28106429/car2221_umbrella_bea...

Now if I use the reader: com.sun.imageio.plugins.jpeg.JPEGImageReader

I get the following

javax.imageio.IIOException: ICC APP2 encountered without prior JFIF!
at com.sun.imageio.plugins.jpeg.JPEGMetadata.(JPEGMetadata.java:263)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.getImageMetadata(JPEGImageReader.java:904)
at tester.ExifSSCCE.runSequence(ExifSSCCE.java:91)

So the recommended solution is to use the alternative reader from ImageIO
com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReader

I get the following

java.lang.IndexOutOfBoundsException: imageIndex out of bounds!
at com.sun.media.imageioimpl.plugins.clib.CLibImageReader.seekToImage(CLibImageReader.java:437)
at com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReader.getImageMetadata(CLibJPEGImageReader.java:305)

Which is the result of the image being progressive and ImageIO being unable to handle it......

so what can I use to extract the metadata from this image?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
imagero
Offline
Joined: 2003-11-18
Points: 0

You may try to filter out APP blocks from your image.
Use com.imagero.uio.io.JpegFilterInputStream.java from UIO library (free/open source)
http://reader.imagero.com/uio/

qwertywin
Offline
Joined: 2006-05-03
Points: 0

Yep that appears to work, though its not exactly elegant.

Thanks.