How to determine if JAI-ImageIo built-in libraries are installed

Is there an easy way to determine if the source JAI binaries are installed?

JAI (Java Advanced Imaging) can work in several modes, both with and without native binary files, which speed up image processing and also add support for additional formats. But, since native libraries cannot be installed with Maven, how can you determine if they are installed on the system?

+6
source share
1 answer

Documenting the solution because it was hard to find. The OpenGeo Toolkit (GeoTools) provides a helper utility for checking if libraries are installed using ImageUtilities.

In short:

  • check out the following class com.sun.medialib.mlib.Image
  • make sure it is not disabled through the property: com.sun.media.jai.disableMediaLib
  • Execute com.sun.medialib.mlib.Image and execute isAvailable()

The code is available via LGPL [ http://svn.osgeo.org/geotools/trunk/modules/library/coverage/src/main/java/org/geotools/resources/image/ImageUtilities.java ]

+6
source

All Articles