Problem with JPEGDecoder class

2007-12-28 Thread Alessandro Maldini
Hello everybody,
I've a problem using your JPEGDecoder class and I hope someone would help me.

I imported in my Project
classpath-0.96.1/gnu/javax/imageio/jpeg/IIOInputStream.java and all
classpath-0.96.1/gnu/javax/imageio/jpeg/* files.

When I try to open a jpeg image in order to decode it, an "Unsupported
JFIF version" exception.
I tried with 25 images but I can't decode anything. When i type file
filename.jpg in a linux console, it says to me "JFIF 1.0".

How can I solve this problem?

I report my code, so you can see if i make a mistake:

String filename = "myFile.jpg";
File file = new File(filename);

JPEGDecoder dec = null;

FileInputStream in = null;
try {
FileImageInputStream fiis = new FileImageInputStream(file);
in = new FileInputStream(file);
dec = new JPEGDecoder(fiis);
} catch (FileNotFoundException e1) {
e1.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}


Thanks a lot,
Alessandro
[EMAIL PROTECTED]



Re: Problem with JPEGDecoder class

2007-12-28 Thread Roman Kennke
Hi Allesandro,

Am Freitag, den 28.12.2007, 12:19 +0100 schrieb Alessandro Maldini:
> Hello everybody,
> I've a problem using your JPEGDecoder class and I hope someone would help me.
> 
> I imported in my Project
> classpath-0.96.1/gnu/javax/imageio/jpeg/IIOInputStream.java and all
> classpath-0.96.1/gnu/javax/imageio/jpeg/* files.
> 
> When I try to open a jpeg image in order to decode it, an "Unsupported
> JFIF version" exception.

This means that the specific JPEG format you are trying is not
supported. The JPEG decoder in Classpath is very incomplete and doesn't
support the mainstream JPEG formats. Your options are: 1. try to use the
OpenJDK JPEG decoder in Classpath somehow (should be possible because it
is designed as a plugin for IIO) 2. try to implement the missing JPEG
formats ;-)

Roman

-- 
http://kennke.org/blog/