Batch conversion utitiles do not recognize JP2

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?".
Post Reply
ineuw
Posts: 2
Joined: 2018-07-09T12:09:24-07:00
Authentication code: 1152

Batch conversion utitiles do not recognize JP2

Post by ineuw »

Code: Select all

Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib
Using Linux Mint 18.3 64bit, I have about 900 JP2 images which need to be converted to .jpg. For 'mogrify' and 'convert' utilities, I installed three related libraries in the following order; openjpeg-2, libopenjp2-tools, and libopenjp2-7-dev, + purged and reinstalled imagemagick ,in case it missed linking these libraries. But it doesn't work, and generates the following message;

Code: Select all

mogrify -path jpg -format jpg -quality 95 *.jp2
mogrify-im6.q16: no decode delegate for this image format `JP2' @ error/constitute.c/ReadImage/504.
What am I doing wrong?
Linux Mint 19.1 Cinnamon 64bit and Windows 10 64bit
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Batch conversion utitiles do not recognize JP2

Post by fmw42 »

JP2 requires the OpenJPEG library v 2.1 or higher. It needs to be installed first then Imagemagick. It should then show up on the convert -version listing as jp2.

From the changelog:

2014-04-22 6.8.9-1 Cristy <quetzlzacatenango@image...>
Require OpenJP2 version 2.1.0 (opj_stream_set_user_data() method signature change between 2.0.0 and 2.1.0).

See http://www.openjpeg.org


When you compile Imagemagick, check the config.log file to see why it is not accepting your openjpeg library.

6.9.7-4 (1/14/2017 patch?) is rather old now. You might consider upgrading to the current release at 6.9.10-5.
Post Reply