openjpeg icon indicating copy to clipboard operation
openjpeg copied to clipboard

Failed to decode J2C image

Open alex-p-k opened this issue 5 years ago • 3 comments

Hi, I get the following error message trying to decompress and save as a BMP the attached J2C image sample.zip

[INFO] Start to read j2k main header (0). [INFO] Main header has been correctly decoded. [INFO] No decoded area parameters, set the decoded area to the whole image [INFO] Header of tile 1 / 1 has been read. [ERROR] read: segment too long (1017) with max (8249) for codeblock 20 (p=0, b=0, r=5, c=0) [ERROR] Failed to decode. [ERROR] Failed to decode tile 1/1 ERROR -> opj_decompress: failed to decode image!

But the image should be fine as it is opened successfully by the ACDSee and Photoshop. Can someone help with this issue?

Thank you.

alex-p-k avatar Aug 10 '20 12:08 alex-p-k

@alex-p-k , this is another JasPer Version 1.900.1 buggy file.

[51]marker(0xff64)
    com  len(35)
    R[1](General use (ISO 8859-1 (latin-1) values))
       T(Creator: JasPer Version 1.900.1)

LINUX:
======================
opj_decompress -i sample.j2c -o sample.j2c.bmp

[INFO] Start to read j2k main header (0).
[INFO] Main header has been correctly decoded.
[INFO] No decoded area parameters, set the decoded area to the whole image
[INFO] Header of tile 1 / 1 has been read.
[ERROR] read: segment too long (1017) with max (8249) for codeblock 20 (p=0, b=0, r=5, c=0)
[ERROR] Failed to decode.
[ERROR] Failed to decode tile 1/1
ERROR -> opj_decompress: failed to decode image!

jiv --version
2.0.16
libjasper 2.0.16

jiv sample.j2c
jpc_dec_decodepkts failed
error: cannot load image data
cannot load image

jasper --input sample.j2c  --output sample.j2c.bmp
jpc_dec_decodepkts failed
error: cannot load image data

kdu_expand -i sample.j2c -o out.bmp
 OK


WIN10:
======================
IrfanView sample.j2c
 Decode error

kdu_show sample.j2c
 OK

winfried

szukw000 avatar Aug 10 '20 14:08 szukw000

@szukw000 Do you mean that the image is just encoded wrong by the JasPer library? I'm a bit confused since it's still successfully opened by two other apps. That is why I thought that there is some problem with the decompression algorithm. And by the way, how did you determine that the JasPer is at fault?

alex-p-k avatar Aug 11 '20 05:08 alex-p-k

encoded wrong by the JasPer library

Yes.

ValZapod avatar Feb 05 '21 06:02 ValZapod