Where can I find a 100%-pure-Java, open source (BSD, LGPL, X11, but
*not* GPL) progressive JPEG _decoder_ which does not rely on AWT, or
can easily be modified to not rely on it?
Ideally it would take an InputStream and return an int[] of samples --
this is the general level of functionality I'm looking for.
Incorrect answers you might be tempted to provide:
* JIMI (uses AWT behind your back for JPEG decoding -- argh!)
* Florian Raemy's decoder and the many derivitaves thereof (no
progressive support)
* IDG (C, not Java)
* JNI callout to C library (sorry, can't use JNI for security reasons)
* GNU Classpath (no AWT support, no JPEG decoder)
Also keep in mind that there are lots of *encoders* but few *decoders*
out there. |
Clarification of Question by
megacz-ga
on
18 Jun 2002 19:32 PDT
JPEG and JPEG2000 are not the same thing. I'm looking for plain old JPEG.
|
Request for Question Clarification by
studboy-ga
on
19 Jun 2002 01:33 PDT
Have you checked out JAI? They have a JPEG decoder:
http://developer.java.sun.com/developer/sampsource/jai/
Just want to make sure I'm on the right track... thanks
|
Request for Question Clarification by
8ball-ga
on
19 Jun 2002 02:56 PDT
I found this:
http://biron.usc.edu/~lengweha/jpeg/jpg.html
I don't know if this meets your needs or not. It seems like a stretch
to me, so I am not posting it as an answer. It looks experimental.
However, it appears to be:
1. pure java
2. open source
3. jpeg decoding independent of awt
On #3, I should make clear. I definitely see awt being called, but I
think it is only being called to put widgets on the screen.
|
Clarification of Question by
megacz-ga
on
19 Jun 2002 09:38 PDT
From the JAI README:
JPEG files are read and written using the classes found in the
com.sun.image.codec.jpeg package of the Java 2 SDK.
com.sun.image.codec.jpeg uses JNI to call a C library. It's also not open source.
|
Clarification of Question by
megacz-ga
on
19 Jun 2002 09:43 PDT
> http://biron.usc.edu/~lengweha/jpeg/jpg.html
Yeah, I've seen this before -- it doesn't support progressive JPEGs.
It also seems a bit broken -- I've tried using it and I can't get it
to display
an image. Does it work for you?
Regardless, I downloaded the source and verified that it doesn't even
attempt progressive support -- see HuffmanDecode.HuffmanDecode(URL,
TextArea) -- the switch block doesn't have a case arm for the
progressive JPEG marker.
This is, however, a good example of what I mean by something that "can
easily
be modified to not rely on AWT". So if this had offerend progressive
support,
it would have been a correct answer.
|
Clarification of Question by
megacz-ga
on
19 Jun 2002 09:56 PDT
You can't use Applet.getImage() either.
|
Request for Question Clarification by
slumpy-ga
on
20 Jun 2002 10:55 PDT
While I am no programmer, a very good friend is, and he suggested you
look at this:
http://lcavwww.epfl.ch/Demos/jpeg/
Hope it helps!!!
slumpy-ga
|
Clarification of Question by
megacz-ga
on
20 Jun 2002 15:20 PDT
> - the source is available in src.jar of every jdk since 1.2.
> This software is the proprietary information of Sun Microsystems,
Inc.
> Use is subject to license terms.
It's not <a href=http://www.opensource.org/docs/definition.php>open
source</a>.
> i don't see any JNI call in the code, maybe i'm missing it, could
> you please tell me where is it?
com.sun.image.codec.jpeg really doesn't do anything; it forwards all
its calls to sun.awt.image.codec.JPEGImageDecoderImpl, which makes JNI
calls:
private native void initDecoder(Class class1);
private synchronized native JPEGDecodeParam
readJPEGStream(InputStream...
Not trying to be difficult here; I just really need something that's
completely self-contained and open source.
- a
|
Clarification of Question by
megacz-ga
on
20 Jun 2002 15:21 PDT
> http://lcavwww.epfl.ch/Demos/jpeg/
That's Florian Raemy's decoder; it doesn't support progressive JPEGs.
|