EXIF images and InputStream mark/reset not supported

O

OtisUsenet

Hi,

I'm using Java2D to scale (resize) images. In the process I deal with
InputStream that contains the image, and I use mark(0) + reset() calls
on this InputStream. I noticed this invariably bombs with certain
types of images, such as this one:

$ file ~/background-images/More.JPG
/home/otis/background-images/More.JPG: JPEG image data, EXIF standard
2.1

But it always works with images of this type:

$ file ~/background-images/Falkusa.jpg
/home/otis/background-images/Falkusa.jpg: JPEG image data, JFIF
standard 1.01

By "bombs" I mean this:
java.io.IOException: mark/reset not supported
at java.io.InputStream.reset(InputStream.java:334)
....
....

So the difference is that one uses EXIF standard and the other one
uses JFIF standard.
Is there any way to avoid this this and get mark/reset type
functionality even with EXIF images?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top