Page 1 of 1

Problem when convert JPEG-2000(jp2) to JPG

Posted: 2012-11-07T19:46:35-07:00
by namle2605
Hi all,

I tried to convert JPEG2000 file to JPG file with Imagemagick on Linux, but I always got following error:

Code: Select all

# convert Full.jp2 Full.jpg
error: cannot decode code stream
convert: unable to decode image file `Full.jp2' @ error/jp2.c/ReadJP2Image/403.
convert: no images defined `Full.jpg' @ error/convert.c/ConvertImageCommand/3044.
I also checked other topics and these are the delegates of my configuration:
DELEGATES bzlib fontconfig freetype jpeg jng jp2 lcms pango png tiff x11 xml zlib
I used ImageMagick 6.7.9-10 2012-10-12 Q16 on CentOS 6.2
My jasper version is 1.900.1
These are files:
https://www.dropbox.com/s/nu7wl4i7th8fdxx/Full.jp2
https://www.dropbox.com/s/qmgs603ismbuts4/Full.jpf

Best regards,
Nam Le

Re: Problem when convert JPEG-2000(jp2) to JPG

Posted: 2012-11-07T20:16:34-07:00
by fmw42
I can open it fine in Mac Preview, but convert does not work without the same error.

I even tried

convert JP2:Full.jp2 full2.jpg


Mac OSX Snow Leopard, IM 6.8.0.3 Q16

Could be something odd about the JP2 file you have.

Re: Problem when convert JPEG-2000(jp2) to JPG

Posted: 2012-11-08T15:57:55-07:00
by fmw42
I suspect this is a bug, but cannot be sure. Other tools open it fine. I can also get information from exiftool.


identify -verbose JP2:Full.jp2

error: cannot decode code stream
identify: unable to decode image file `Full.jp2' @ error/jp2.c/ReadJP2Image/403.



exiftool Full.jp2

ExifTool Version Number : 8.71
File Name : Full.jp2
Directory : .
File Size : 74 kB
File Modification Date/Time : 2012:11:08 14:50:51-08:00
File Permissions : rw-r--r--
File Type : JP2
MIME Type : image/jp2
Major Brand : JPEG 2000 Image (.JP2)
Minor Version : 0.0.0
Compatible Brands : jp2 , jpxb, jpx
Image Height : 585
Image Width : 1241
Number Of Components : 4
Bits Per Component : 8 Bits, Unsigned
Compression : JPEG 2000
Color Spec Method : Enumerated
Color Spec Precedence : 2
Color Spec Approximation : Accurate
Color Space : CMYK
Capture Y Resolution : 5905
Capture X Resolution : 5905
Capture Y Resolution Unit : m
Capture X Resolution Unit : m
Image Size : 1241x585
c-98-234-217-52:desktop fred$

It is a guess that IM cannot handle the CMYK format of JP 2000.


I would recommend that you report this on the Bugs forum and put a link back to this topic.

Re: Problem when convert JPEG-2000(jp2) to JPG

Posted: 2012-11-08T19:28:21-07:00
by namle2605
Thanks fmw42 for your support.
I reported the issue on Bug forum.
viewtopic.php?f=3&t=22238