Has anyone had a problem loading jpeg files in java? One of our clients sends files that cannot be resolved, but the same files can be opened in windows. (the remaining 99% of the jpeg files we receive are processed without problems)
I tried several libraries to read them:
itextpdf : com.itextpdf.text.Jpeg (getInstance(imageData) - gives "java.io.IOException: Premature EOF while reading JPG." sanselan : org.apache.sanselan.ImageInfo ( Sanselan.getImageInfo(imageData) gives "java.io.IOException: Invalid Segment: insufficient data") where imageData is a byte[]
The errors here tell me that jpegs are broken, however this does not explain why they are still viewable.
If anyone has any suggestions, I would be very grateful
thanks
source share