Export to GitHub

openjpeg - issue #234

Problem with LAB images?


Posted on Sep 3, 2013 by Happy Wombat

What steps will reproduce the problem?

1.I rendered the PDF http://www.eci.org/_media/downloads/altona_test_suite/eci_altona-test-suite-v2_technical2_x4.pdf with poppler and the openjpeg library (bot released 2.0.0 and svn trunk), but I wasn't able to render two of the jp2 compressed images. 2. Then I extract all the images of that PDF and opened the .jp2 image files with Adobe Photoshop, all of them with success. 3. Then I used opj_decompress with the extacted .jp2 files. I could decompress all beside the two attached images. The difference to the images I could decompress is that these both images are in LAB colorspace (according what Photoshop says!)

What is the expected output? What do you see instead?

Even if opj_decompress will not be able to convert these two images to PGM, the library should not refuse such images. poppler would be able to read LAB images but cannot convert them because it doesn't get the image data from openjpeg.

What version of the product are you using? On what operating system?

openjpeg 2.0.0 and svn trunk on Ubuntu 12.0.4

Please provide any additional information below.

The error message for both images with opj_decompress is: [ERROR] Bad BPCC header box (bad size) ERROR -> opj_decompress: failed to read the header

Attachments

Comment #1

Posted on Sep 4, 2013 by Happy Wombat

The problem is in jp2.c in this code fragment:

if (jp2->meth == 1) {
    if (p_colr_header_size != 7) {
        opj_event_msg(p_manager, EVT_ERROR, "Bad BPCC header box (bad size)\n");
        return OPJ_FALSE;
    }

    opj_read_bytes(p_colr_header_data,&jp2->enumcs ,4);         /* EnumCS */
}

The problem is that p_colr_header_size is 35 (I think some additional values for LAB). If I comment the return

if (jp2->meth == 1) {
    if (p_colr_header_size != 7) {
        opj_event_msg(p_manager, EVT_ERROR, "Bad BPCC header box (bad size)\n");

// return OPJ_FALSE; }

    opj_read_bytes(p_colr_header_data,&jp2->enumcs ,4);         /* EnumCS */

everything works like a charme

Comment #2

Posted on Sep 4, 2013 by Happy Wombat

According to http://www.jpeg.org/public/15444-2annexm.pdf the p_colr_header_size of 35 is correct for ecumcs=14, because CieLAB has here 7 additional 32 bit values following the enumcs entry.

Comment #3

Posted on Feb 25, 2014 by Helpful Giraffe

(No comment was entered for this change.)

Comment #4

Posted on Feb 26, 2014 by Helpful Giraffe

This issue has been fixed in r2464. Closing.

Status: Fixed

Labels:
Type-Defect Priority-Medium Milestone-Release2.1