SRK
SRK

Reputation: 105

How to update dependency to existing ImageMagick

ImageMagick 6.8.9-9 Q16 x86_64 2018-09-28 is already installed on Ubuntu 16.04.5 LTS Xenial. Was trying to convert jp2 to jpg but i got the below error

mogrify: no decode delegate for this image format 'JP2' @ error/constitute.c/ReadImage/501.

I followed few articles and they said jp2 file support is missing so i installed successfully using command sudo apt-get install libopenjp2-7-dev.

When i do identify -version it does not show jp2 under delegates :

Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib

Could anyone please help me how to include into existing ImageMagick

  1. List item

Upvotes: 1

Views: 1574

Answers (1)

u2n
u2n

Reputation: 407

Same problem, mind-blowing to distribute w/o jp2 support. Not aware of any way to add this after installation (since it's compiled in), but did solve the problem with a new install:

sudo apt purge imagemagick
sudo apt autoremove
sudo apt install libopenjp2-7 libopenjp2-7-dev libopenjp2-tools opencl-headers

Then cd to desired parent dir and:

wget https://imagemagick.org/download/ImageMagick.tar.gz
tar xvzf ImageMagick.tar.gz

CD to newly created dir and, as normal:

./configure
make
sudo make install

Followed by:

sudo ldconfig /usr/local/lib

IM will try to install jp2 support by default so no need to add a configure option.

Lastly, IM's reference page notes that a modules build is recommended for advanced users. At the configure step, do instead:

./configure --with-modules --enable-shared --with-perl

PS. My config line, FWIW:

./configure --with-modules --enable-shared --with-perl --with-gslib --with-rsvg

Upvotes: 2

Related Questions