NATIVE Jpegs in Java

hi2all :D,

i wrote as small image lib for reading jpg-files.
it’s a JNI program which wraps jpeg-6b.

Requirements: (Linux || Windows) && Java >= 1.5

it’s one zip file.
extract it and call “ant” for the test.
if you see an image of the “geiranger fjord”, everthing’s allright.

very simple usage:
BufferedImage img = FastImage.readImage(“myImage.jpg”);

http://filebee.org/devel/

any comments?

have fun, :smiley: :smiley: :smiley:
olaf

What’s the performance like?

Have you considered submitting improvements to the JPEG loader in Mustang?

Where does that string load the image from, files or classpath?

Kev

argument is a path of filesystem

lib tested under linux+windows, java 1.5, no special options

benchmarks:
i’ve tested the lib right now on windows + linux loading a bunch of fotos from a directory.
both system: it’s ~30,35 % “faster” than tradtional ImageIO.

…but not fast enough, i think.

i’ ll look for an other c/c++ - source-jpeg-decoder lib to put into a JNI wrapper…

any suggestions ?

This isn’t going to be useful for webstart apps - or portable apps :frowning:

http://openil.sourceforge.net/ is meant to be the one to use and is reported as quite quick. However, why exactly are you wanting a native library? If you’re loading textures JPG isn’t a great a choice - TGA compresses almost aswell in zip a file and the loading even in java can be really really fast.

Kev

I think that native libs are not harder to deploy via webstart than JOGL oder LWJGL,…
I don’t need jpg loader for textures. need it for image-loading in general.

Na, this statement:

This isn’t going to be useful for webstart apps - or portable apps

wasn’t aimed at it being native, but at the string being a filesystem reference - which in webstart terms isn’t very useful. Generally you want the string to be a URL reference backed up with a fallback to filesystem.

As to native being easy to distribute, sure. However, the more natives you depend on the more trouble you have porting later on and more issues you can get with code you don’t have easy control over.

But heh, its your choice of course.

Kev

As I posted here, I believe an ImageIO Plugin would be the best solution. This should also work well loading as resource. But maybe a loading from a url/stream isn’t possible (fast). I recently ask for opinions on that there. ::slight_smile:

A 30% speed increase wont be worth it. (With 1.6 ImageIO became way faster btw.)

No mac support and the 1.5+ requirement is also a big no-no.