Skip to main content

Is there a way to detect if the native jai_imageio is installed?

4 replies [Last post]
langfors
Offline
Joined: 2005-11-17

For performance reasons we require our clients to install the native jai_imageio library in order to use our product. Is there a way for us to determine if our clients have met this requirement? Is there a way to determine software only vs native?

Thanks in advance

Sean

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Martin Desruisseaux

Le 06/08/10 20:55, jai-imageio@javadesktop.org a écrit :
> For performance reasons we require our clients to install the native jai_imageio library in order to use our product. Is there a way for us to determine if our clients have met this requirement?

The following may be of some inspiration:

http://hg.geotoolkit.org/geotoolkit/file/a7c396f4cdb3/modules/coverage/g...

Note: from my experience, don't assume that native codecs are faster or better
than the Java one. The reality is sometime the opposite. We really need to test
all of them on a case-by-case basis with real data.

Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Martin Desruisseaux

Le 06/08/10 23:34, Martin Desruisseaux a écrit :
> Le 06/08/10 20:55, jai-imageio@javadesktop.org a écrit :
>> For performance reasons we require our clients to install the native
>> jai_imageio library in order to use our product. Is there a way for us to
>> determine if our clients have met this requirement?

To be more accurate, when native jai_imageio library is installed, both native
codec and Java coded are registered in javax.imageio.spi.IIORegistry. Whatever
the native or the Java codec will be actually used is random and can very
between two executions of the same program.

To make a determinist choice, the preference for native or Java codec must be
explicitly specified, through a call to the IIORegistry.setOrdering(...) method.
The code referenced in my previous email:

> The following may be of some inspiration:
>
> http://hg.geotoolkit.org/geotoolkit/file/a7c396f4cdb3/modules/coverage/g...

does exactly that. As you can see, it just scans the registered plugins and set
the preferred ordering.

Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

langfors
Offline
Joined: 2005-11-17

Thank you very much Bob and Martin. Very useful.

Cheers

Sean

Bob Deen

It certainly is possible, because the library itself checks and prints a
message if it's not there.

I don't recall it being a part of the public API, but you can always do
whatever the library itself is doing. The JAI source (except for the
native code itself, alas) is available from cvs:

https://jai-core.dev.java.net/source/browse/jai-core/

You can try searching for the message that is issued and work backwards,
or look for calls to System.loadLibrary().

Good luck...

-Bob

jai-imageio@javadesktop.org wrote:
> For performance reasons we require our clients to install the native jai_imageio library in order to use our product. Is there a way for us to determine if our clients have met this requirement? Is there a way to determine software only vs native?
>
> Thanks in advance
>
> Sean
> [Message sent by forum member 'langfors']
>
> http://forums.java.net/jive/thread.jspa?messageID=479512
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net