문제

Is there an easy way to detect whether JAI's native binaries are installed?

JAI (Java Advanced Imaging) can run in multiple modes both with and without the native binaries that make it process images faster and also add support for additional formats. But, as the native libraries cannot be installed with Maven, how can you detect whether they're installed in the system?

도움이 되었습니까?

해결책

Documenting solution as it was difficult to find. The OpenGeo (GeoTools) toolkit provides a helper utility for checking whether the libraries are installed via it's ImageUtilities.

In summary:

  • check for the following classcom.sun.medialib.mlib.Image
  • check that it's not disabled via property: com.sun.media.jai.disableMediaLib
  • Instantiate com.sun.medialib.mlib.Image and execute isAvailable()

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top