1

I'm currently working on a CentOS 6.5 server. I'm trying to use openjp2 as one of the delegates in ImageMagick.

Since openjpeg for CentOS is outdated (1.3), I've installed a new one using RPM package.

$ find /usr | grep openj
/usr/lib64/libopenjp2.so
/usr/lib64/libopenjp2.so.2.0.0
/usr/lib64/openjpeg-2.0
/usr/lib64/openjpeg-2.0/OpenJPEGConfig.cmake
/usr/lib64/openjpeg-2.0/OpenJPEGTargets.cmake
/usr/lib64/openjpeg-2.0/OpenJPEGTargets-release.cmake
find: `/usr/lib64/audit': Permission denied
/usr/lib64/libopenjp2.so.6
/usr/share/doc/openjpeg2
/usr/share/doc/openjpeg2/CHANGES
/usr/share/doc/openjpeg2/LICENSE
/usr/share/doc/openjpeg-2.0
/usr/share/doc/openjpeg-2.0/CHANGES
/usr/share/doc/openjpeg-2.0/LICENSE
/usr/share/man/man3/libopenjp2.3.gz
/usr/share/man/man3/libopenjp2.3
/usr/lib/libopenjp2.so
/usr/lib/libopenjp2.so.2.0.0
/usr/lib/openjpeg-2.0
/usr/lib/openjpeg-2.0/OpenJPEGConfig.cmake
/usr/lib/openjpeg-2.0/OpenJPEGTargets-noconfig.cmake
/usr/lib/openjpeg-2.0/OpenJPEGTargets.cmake
/usr/lib/libopenjp2.so.6
/usr/include/openjpeg-2.0
/usr/include/openjpeg-2.0/openjpeg.h
/usr/include/openjpeg-2.0/opj_config.h
/usr/include/openjpeg-2.0/opj_stdint.h

Next, I'm trying to build IM version 6.8.8-2 using the following configure settings.

./configure --prefix=/usr --with-modules --with-openjp2 --with-jpeg --with-png --with-tiff --enable-shared --disable-static

However, during the checking (logs), I found this.

-------------------------------------------------------------
checking for LIBOPENJP2... no

And the result delegates are:

bzlib djvu mpeg fontconfig freetype gslib jng jpeg lcms openexr png ps rsvg tiff x xml zlib

Running ./configure --help, I saw some flags you can pass.

LIBOPENJP2_CFLAGS
  C compiler flags for LIBOPENJP2, overriding pkg-config
LIBOPENJP2_LIBS
    linker flags for LIBOPENJP2, overriding pkg-config

Is there something that I need to specify during the ./configure? It looks like IM cannot see the installed openjpeg.

Thanks!

3 Answers 3

2

You didn't mention exactly what package you installed, but your error indicates that you didn't install its related -devel package, which is necessary to compile software against it.

1

I just ran into this issue (on CentOS 7) and found that the problem was because I had not installed the openjpeg-devel package.

yum install openjpeg2-devel

While searching for solutions it also appears that ImageMagick currently only supports OpenJPEG 2.1.

1

Compiling this was a bit painful, I should learn to read the logs :( ... Indeed, you need to use the source for jp2 from here Then compile as required in INSTALL.md:

cmake .
make && make install

By default, installation is in /usr/local

Go to you ImageMagick source dir, then set:

export LIBOPENJP2_CFLAGS=/usr/local/include/openjpeg-2.1
export LIBOPENJP2_LIBS=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Then you can compile ! (I've compile with perl, tiff, jpeg and jpeg2000).

./configure --enable-delegate-build --with-perl --enable-shared=yes --with-jpeg=yes --with-tiff=yes --with-openjp2=yes && make && make install

Done !

$> convert -list
Version: ImageMagick 7.0.5-0 Q16 x86_64 2017-03-02 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP
Delegates (built-in): fontconfig freetype jng jp2 jpeg png tiff x zlib
Usage: convert [options ...] file [ [options ...] file ...] [options ...] file

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .