OpenJP2 delegate on 6.8.9

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
hapiben
Posts: 15
Joined: 2014-07-10T20:10:02-07:00
Authentication code: 6789

OpenJP2 delegate on 6.8.9

Post by hapiben »

Hi,

I'm currently in the process of updating ImageMagick in one of our servers. I'm trying to update it to 6.8.9 version. Everything looks, but I can't make openjp2 as part of the delegates.

I'm using CentOS 6.5 with the following version of dependencies:

Code: Select all

openjpeg.x86_64 - 1.3-10.el6_5
openjpeg-libs - 1.3-10.el6_5
openjpeg-devel - 1.3-10.el6_5
Still I'm getting the following delegates:

Code: Select all

DELEGATES mpeg jng jpeg png tiff xml zlib
Configure parameters:

Code: Select all

./configure --prefix=/usr --with-modules --with-openjp2 --with-jpeg --with-png --with-tiff --enable-shared --disable-static --without-magick-plus-plus
I also found this in the logs:

Code: Select all

checking for LIBOPENJP2... no
Could it because I'm using an old version of openjp2 packages? If yes, how do you determine the right ImageMagick version for your openjp2 packages?

Thanks.

Looking at the config in the logs:

Code: Select all

Host system type: x86_64-unknown-linux-gnu
Build system type: x86_64-unknown-linux-gnu

                  Option                        Value
-------------------------------------------------------------------------------
Shared libraries  --enable-shared=yes		yes
Static libraries  --enable-static=no		no
Module support    --with-modules=yes		yes
GNU ld            --with-gnu-ld=yes		yes
Quantum depth     --with-quantum-depth=16	16
High Dynamic Range Imagery
                  --enable-hdri=no		no

Install documentation:		yes

Delegate Configuration:
BZLIB             --with-bzlib=yes		no
Autotrace         --with-autotrace=no		no
Dejavu fonts      --with-dejavu-font-dir=default	none
DJVU              --with-djvu=yes		no
DPS               --with-dps=yes		no
FFTW              --with-fftw=yes		no
FlashPIX          --with-fpx=yes		no
FontConfig        --with-fontconfig=yes		no
FreeType          --with-freetype=yes		no
GhostPCL          None				pcl6 (unknown)
GhostXPS          None				gxps (unknown)
Ghostscript       None				gs (unknown)
Ghostscript fonts --with-gs-font-dir=default	none
Ghostscript lib   --with-gslib=no		no
Graphviz          --with-gvc=no		
JBIG              --with-jbig=yes		no
JPEG v1           --with-jpeg=yes		yes
JPEG-2000         --with-jp2=		
LCMS v1           --with-lcms=yes		no
LCMS v2           --with-lcms2=yes		no
LQR               --with-lqr=yes		no
LTDL              --with-ltdl=yes		yes
LZMA              --with-lzma=yes		no
Magick++          --with-magick-plus-plus=no	no
OpenEXR           --with-openexr=yes		no
OpenJP2           --with-openjp2=yes		no
PANGO             --with-pango=yes		no
PERL              --with-perl=no		no
PNG               --with-png=yes		yes
RSVG              --with-rsvg=no		no
TIFF              --with-tiff=yes		yes
WEBP              --with-webp=yes		no
Windows fonts     --with-windows-font-dir=	none
WMF               --with-wmf=no		no
X11               --with-x=			no
XML               --with-xml=yes		yes
ZLIB              --with-zlib=yes		yes

X11 Configuration:
      X_CFLAGS        = 
      X_PRE_LIBS      = 
      X_LIBS          = 
      X_EXTRA_LIBS    = 

Options used to compile and link:
  PREFIX          = /usr
  EXEC-PREFIX     = /usr
  VERSION         = 6.8.9
  CC              = gcc -std=gnu99 -std=gnu99
  CFLAGS          = -fopenmp -g -O2 -Wall -march=core2 -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
  CPPFLAGS        = -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/libxml2
  PCFLAGS         = 
  DEFS            = -DHAVE_CONFIG_H
  LDFLAGS         = 
  LIBS            = 
  CXX             = g++
  CXXFLAGS        = -g -O2 -pthread
  FEATURES        = DPC OpenMP Modules
  DELEGATES       = mpeg jng jpeg png tiff xml zlib
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: OpenJP2 delegate on 6.8.9

Post by fmw42 »

I believe that you need a 2.1 version of OpenJPEG. I had problems myself and somewhere in the forum, this was discovered and fixed in a relatively recent version of IM. see viewtopic.php?f=3&t=25416&p=111446&hili ... eg#p111446

download at http://sourceforge.net/projects/openjpe ... les/2.1.0/
hapiben
Posts: 15
Joined: 2014-07-10T20:10:02-07:00
Authentication code: 6789

Re: OpenJP2 delegate on 6.8.9

Post by hapiben »

Thanks fmw42. I'll get the latest version and will update this thread with the result. Cheers!
hapiben
Posts: 15
Joined: 2014-07-10T20:10:02-07:00
Authentication code: 6789

Re: OpenJP2 delegate on 6.8.9

Post by hapiben »

Hi @fmw42,

I've installed 2.1.0 version of openjpeg with the following install manifest:

Code: Select all

/usr/local/lib/openjpeg-2.1/OpenJPEGTargets.cmake
/usr/local/lib/openjpeg-2.1/OpenJPEGTargets-noconfig.cmake
/usr/local/lib/openjpeg-2.1/OpenJPEGConfig.cmake
/usr/local/lib/pkgconfig/libopenjp2.pc
/usr/local/include/openjpeg-2.1/opj_config.h
/usr/local/lib/libopenjp2.so.2.1.0
/usr/local/lib/libopenjp2.so.7
/usr/local/lib/libopenjp2.so
/usr/local/include/openjpeg-2.1/openjpeg.h
/usr/local/include/openjpeg-2.1/opj_stdint.h
/usr/local/bin/opj_decompress
/usr/local/bin/opj_compress
/usr/local/bin/opj_dump
Running ./configure in ImageMagick dist with the following options:

Code: Select all

./configure --prefix=/usr --with-modules --with-openjp2 --with-jpeg --with-png --with-tiff --enable-shared --disable-static --without-magick-plus-plus
Still don't have openjp2

Code: Select all

DELEGATES       = mpeg jng jpeg lcms png tiff xml zlib
Is there something I need to do when building openjp2? Or do I miss an option in the ./configure?

Thanks.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: OpenJP2 delegate on 6.8.9

Post by fmw42 »

try adding --with-jp2 rather than --with-openjp2
hapiben
Posts: 15
Joined: 2014-07-10T20:10:02-07:00
Authentication code: 6789

Re: OpenJP2 delegate on 6.8.9

Post by hapiben »

Gave me a warning:

Code: Select all

configure: WARNING: unrecognized options: --with-jp2
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: OpenJP2 delegate on 6.8.9

Post by fmw42 »

Sorry, I think that was the old one for the Jasper library.

This is my ./configure file for installing IM from source on my Mac and getting all my delegates from MacPorts. It does not specify anything about openjp2 or jp2 and it works fine.

./configure CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' \
--enable-delegate-build --enable-shared --disable-static --disable-opencl \
--with-modules --with-quantum-depth=16 --with-gslib --without-wmf --with-rsvg \
--disable-silent-rules --disable-dependency-tracking --disable-openmp --without-pango \
--with-gs-font-dir=/opt/local/share/ghostscript/fonts/ --with-lqr

Here is the listing from running the above:

...
OpenJP2 --with-openjp2=yes yes
...
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: OpenJP2 delegate on 6.8.9

Post by snibgo »

./configure --help lists the options, so we can see the defaults. I don't know if the list is different on different systems, but on mine (Cygwin on Windows 8.1), it shows "--without-openjp2", so I have to disable it if I don't want it.

(It then fails to link to openjp2. I suppose I would need to download something else if I wanted it.)
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: OpenJP2 delegate on 6.8.9

Post by fmw42 »

I get the same as snibgo with ./configure --help. So that implies that one need do nothing to have IM configure OpenJpeg2 so long as that delegate was properly installed prior to installing IM. Be sure that your installation of OpenJpeg2 completed without error.
hapiben
Posts: 15
Joined: 2014-07-10T20:10:02-07:00
Authentication code: 6789

Re: OpenJP2 delegate on 6.8.9

Post by hapiben »

Hi, I tried to rebuild openjpeg2.1 using the following commands.

Code: Select all

sudo cmake -DCMAKE_INSTALL_PREFIX=/usr
sudo make install
sudo make clean
Gave me the following installation manifest.

Code: Select all

/usr/lib/openjpeg-2.1/OpenJPEGTargets.cmake
/usr/lib/openjpeg-2.1/OpenJPEGTargets-noconfig.cmake
/usr/lib/openjpeg-2.1/OpenJPEGConfig.cmake
/usr/lib/pkgconfig/libopenjp2.pc
/usr/include/openjpeg-2.1/opj_config.h
/usr/lib/libopenjp2.so.2.1.0
/usr/lib/libopenjp2.so.7
/usr/lib/libopenjp2.so
/usr/include/openjpeg-2.1/openjpeg.h
/usr/include/openjpeg-2.1/opj_stdint.h
/usr/bin/opj_decompress
/usr/bin/opj_compress
/usr/bin/opj_dump
Using the .configure options mentioned, I modified the paths.

Code: Select all

sudo ./configure --prefix=/usr CPPFLAGS='-I/usr/include' LDFLAGS='-L/usr/lib' \
--enable-delegate-build --enable-shared --disable-static --disable-opencl --with-openjp2 \
--with-modules --with-quantum-depth=16 --with-gslib --without-wmf --with-rsvg \
--disable-silent-rules --disable-dependency-tracking --disable-openmp --without-pango \
--with-gs-font-dir=/usr/local/share/ghostscript/fonts/ --with-lqr
Options logged after the .configure command.

Code: Select all

Options used to compile and link:
  PREFIX          = /usr
  EXEC-PREFIX     = /usr
  VERSION         = 6.8.9
  CC              = gcc -std=gnu99 -std=gnu99
  CFLAGS          = -g -O2 -Wall -march=core2 -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
  CPPFLAGS        = -I/usr/include -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/opt/ImageMagick-6.8.9-6/magick -I/opt/ImageMagick-6.8.9-6/wand -I/usr/include/libxml2
  PCFLAGS         = 
  DEFS            = -DHAVE_CONFIG_H
  LDFLAGS         = -L/usr/lib -L/opt/ImageMagick-6.8.9-6/magick -L/opt/ImageMagick-6.8.9-6/wand
  LIBS            = 
  CXX             = g++
  CXXFLAGS        = -g -O2 -pthread
  FEATURES        = DPC Modules
  DELEGATES       = mpeg jng jpeg lcms png tiff xml zlib
Is there something that I missed? Sorry for asking too much. Thank you for your time.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: OpenJP2 delegate on 6.8.9

Post by fmw42 »

I am not an expert in installing delegates. I am on a Mac and use MacPorts to install them.

This is what I have. From MacPorts, it currently has openjpeg 2.1.0, which is what I installed. It shows these dependencies.

Dependencies: cmake jbigkit lcms2 libpng pkgconfig tiff zlib


Searching for relevant installed files, I have

find /opt | grep "openjp2"
/opt/local/lib/libopenjp2.2.1.0.dylib
/opt/local/lib/libopenjp2.7.dylib
/opt/local/lib/libopenjp2.dylib
/opt/local/lib/pkgconfig/libopenjp2.pc


I would look in the openjpeg 2.1.0 download folder and see if there is a config.log file and see if it reports any errors. Perhaps it needs some other dependent support library that needs to be installed beforehand
hapiben
Posts: 15
Joined: 2014-07-10T20:10:02-07:00
Authentication code: 6789

Re: OpenJP2 delegate on 6.8.9

Post by hapiben »

Hi, you're correct. It looks like some dependencies are not satisfied. Do you know what version of IM is compatible with openjpeg1.3?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: OpenJP2 delegate on 6.8.9

Post by fmw42 »

hapiben wrote:Hi, you're correct. It looks like some dependencies are not satisfied. Do you know what version of IM is compatible with openjpeg1.3?
None. IM's use of openjpeg requires v2.1 or higher. Otherwise, older versions of IM used the Jasper delegate library for jp2 files. But you have to go back to before IM switched to using openjpeg, which is I believe prior to IM 6.8.8-2.

Jasper is not as full featured as Openjpeg. See http://en.wikipedia.org/wiki/JPEG_2000#Libraries
hapiben
Posts: 15
Joined: 2014-07-10T20:10:02-07:00
Authentication code: 6789

Re: OpenJP2 delegate on 6.8.9

Post by hapiben »

Hi, thanks for the info. Unfortunately, I can't use OpenJPEG 2.1 due to required dependencies that CentOS 6.5 doesn't have.

Code: Select all

libc.so.6(GLIBC_2.14)(64bit) is needed by openjpeg-2.1.0-0.x86_64
liblcms2.so.2()(64bit) is needed by openjpeg-2.1.0-0.x86_64
libm.so.6(GLIBC_2.15)(64bit) is needed by openjpeg-2.1.0-0.x86_64
libpng16.so.16()(64bit) is needed by openjpeg-2.1.0-0.x86_64
libpng16.so.16(PNG16_0)(64bit) is needed by openjpeg-2.1.0-0.x86_64
libtiff.so.5()(64bit) is needed by openjpeg-2.1.0-0.x86_64
zlib >= 1.2.8-1 is needed by openjpeg-2.1.0-0.x86_64
CentOS 6.5 currently uses glibc 2.12 and it's not recommended to update as it will affect the whole OS.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: OpenJP2 delegate on 6.8.9

Post by fmw42 »

I think you will need to fall back to an older version of IM that uses Jasper, if you need jp2 support. But perhaps one of the IM developers can confirm this as I am not a JP2 expert.
Post Reply