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!
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!