kok216 / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

openjpeg decompress return false #328

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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

Original issue reported on code.google.com by xiaochua...@gmail.com on 3 Apr 2014 at 8:26

Attachments:

GoogleCodeExporter commented 8 years ago
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

Original comment by szukw...@arcor.de on 3 Apr 2014 at 4:59

Attachments:

GoogleCodeExporter commented 8 years ago
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

Original comment by xiaochua...@gmail.com on 4 Apr 2014 at 3:08

GoogleCodeExporter commented 8 years ago

Original comment by mathieu.malaterre on 28 Apr 2014 at 7:51