openjpeg icon indicating copy to clipboard operation
openjpeg copied to clipboard

openjpeg decompress return false

Open gcode-importer opened this issue 11 years ago • 5 comments

Originally reported on Google Code with ID 328

There are two jp2 images, found in attach.

opj_decompress exe get nothing output, I found 
    if (l_current_data + l_seg->newlen > p_src_data + p_max_length) {
        return OPJ_FALSE;   // run here
    }
in opj_t2_read_packet_data function.


But kakadu lib works OK, is there any problem?


the versoin of openjpeg is v2.0.0

Reported by xiaochuan.liu19880512 on 2014-04-03 08:26:36


- _Attachment: [data_1_output_WriteFile_2.jp2](https://storage.googleapis.com/google-code-attachments/openjpeg/issue-328/comment-0/data_1_output_WriteFile_2.jp2)_ - _Attachment: [Ninja.jp2](https://storage.googleapis.com/google-code-attachments/openjpeg/issue-328/comment-0/Ninja.jp2)_

gcode-importer avatar Apr 03 '14 08:04 gcode-importer

I use openjpeg-2.x-trunk-r2833.

kdu_expand -i issue328-Ninja.jp2 -o issue328-Ninja-kdu.bmp

Error in Kakadu File Format Support:
Illegal tag offset or length value supplied in JP2 embedded icc profile.


kdu_expand -i issue328-data_1_output_WriteFile_2.jp2 -o issue328-data_1_output_WriteFile_2-kdu.bmp

Consumed 3 tile-part(s) from a total of 1 tile(s).

------


[INFO] A conforming JP2 reader shall ignore all Colour Specification boxes after the
first, so we ignore this one.
[INFO] A conforming JP2 reader shall ignore all Colour Specification boxes after the
first, so we ignore this one.
[INFO] Start to read j2k main header (4991).
[INFO] Main header has been correctly decoded.
[INFO] No decoded area parameters, set the decoded area to the whole image
[INFO] Header of tile 0 / 0 has been read.
[INFO] Tile 1/1 has been decoded.
[INFO] Image data has been updated with tile 1.

[INFO] Stream reached its end !
/sources/LIB/IMAGE_FORMATS/OPENJPEG/TRUNK/openjpeg-2.x-trunk-r2833-1/src/bin/jp2/convert.c:3547:sgnd(0,0,0)
w(200) h(122) alpha(0)
Successfully generated Outfile issue328-Ninja.jp2.png


opj_decompress -i issue328-data_1_output_WriteFile_2.jp2 -o issue328-data_1_output_WriteFile_2.jp2.png

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


winfried

Reported by szukw000 on 2014-04-03 16:59:03


- _Attachment: issue328-Ninja.jp2.png
![issue328-Ninja.jp2.png](https://storage.googleapis.com/google-code-attachments/openjpeg/issue-328/comment-1/issue328-Ninja.jp2.png)_

gcode-importer avatar Apr 03 '14 16:04 gcode-importer

sorry, i forgot to tell you that kakadu return error about "Illegal tag offset or length
value supplied in JP2 embedded icc profile", i had fixed that bug of kakadu just ignore
icc profile.

so, i think openjpeg should do something to generated outfile successfully.

is this workable?

thanks!

lxc

Reported by xiaochuan.liu19880512 on 2014-04-04 03:08:41

gcode-importer avatar Apr 04 '14 03:04 gcode-importer

Reported by malaterre on 2014-04-28 07:51:46

  • Labels added: Priority-Low
  • Labels removed: Priority-Medium

gcode-importer avatar Apr 28 '14 07:04 gcode-importer

@gcode-importer can you help me to know how you ignore the icc profile in kakadu i am also trying to use kdu_expand on a jp2 file but its saying

Error in Kakadu File Format Support: The `curv' data type used to represent an embedded ICC profile's tone

faheemziker avatar May 05 '18 08:05 faheemziker

@gcode-importer can you help me to know how you ignore the icc profile in kakadu i am also trying to use kdu_expand on a jp2 file but its saying

Error in Kakadu File Format Support: The `curv' data type used to represent an embedded ICC profile's tone

gcode_importer is a bot. Sigh. kdu_expand does not ignore icc profile, it ignores additional icc profiles. You can remove icc profile with exiftool.

ValZapod avatar May 11 '22 08:05 ValZapod