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

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top