Adding ImageIO plugins to project...


2004-05-07 06:16:06 AM
jbuilder2
Hi,
I'm trying to use the new ImageIO plugins to my project.
I've downloaded and installed the jar's and dll's in the
places specified by the installation guide.
The jar files go into
jre/lib/ext
and the one dll goes into
jre/bin/clib_jiio.dll
NOTE: I didn't install these into the JBuilder jre. I
installed them into a parallel JDK installation that I
use for creating libraries etc.
Now ImageIO is used with Java Advanced Imageing (JAI).
And I have made a library that points to the JAI jars
added that library to my project and I am able to compile
and run JAI programs.
Now I want to use the JPEG2000 image type. To do that,
I must use the ImageIO plugins that I have downloaded
and installed. But the plugins appear to be in the dll
I mentioned above. But when I make a library that includes
the path to the dll and add it to my project, I don't get
the plugins.
So I need to know how to create a library that points to
the dll so I can access the plugins in the ImageIO API.
To make things more complicated, the JDK ships with the ImageIO
class but that is not the ImageIO API.
If you put the code fragment below into an app or applet, you
will see what image file types are supported by the ImageIO class
import javax.imageio.*;
import java.util.Arrays;
String readFormats[] = ImageIO.getReaderMIMETypes();
String writeFormats[] = ImageIO.getWriterMIMETypes();
System.out.println("Readers: " + Arrays.asList(readFormats));
System.out.println("Writers: " + Arrays.asList(writeFormats));
Which now produces:
Readers: [image/png, image/jpeg, image/x-png, image/gif]
Writers: [image/png, image/jpeg, image/x-png]
If and when I manage to link to the dll I mentioned, you will
see a list like:
Readers: [image/png, image/x-portable-graymap,
image/jpeg, image/jpeg2000, image/x-png,
image/tiff, image/vnd.wap.wbmp, image/x-portable-pixmap,
image/x-portable-bitmap, image/bmp, image/gif,
image/x-portable-anymap, ]
Writers: [image/png, image/x-portable-graymap, image/jpeg,
image/jpeg2000, image/x-png, image/tiff,
image/vnd.wap.wbmp, image/x-portable-pixmap,
image/x-portable-bitmap, image/bmp,
image/x-portable-anymap, ]
So the question is --
How do I force the linking of jre/bin/clib_jiio.dll ?????