Export to GitHub

openjpeg - issue #428

issue412 revisited


Posted on Nov 13, 2014 by Grumpy Elephant

Log message [trunk] fixed a bug preventing palette image with cdef to decode properly (fixes issue 412 )

'opj_jp2_apply_cdef()' is shifted down below 'opj_jp2_apply_pclr():

jp2.c, opj_jp2_decode(), line 1420:

    if(jp2->color.jp2_pclr) {
        /* Part 1, I.5.3.4: Either both or none : */
        if( !jp2->color.jp2_pclr->cmap)
            opj_jp2_free_pclr(&(jp2->color));
        else
            opj_jp2_apply_pclr(p_image, &(jp2->color));
    }

    /* Apply the color space if needed */
    if(jp2->color.jp2_cdef) {
        opj_jp2_apply_cdef(p_image, &(jp2->color));
    }

But here it is not shifted down: jp2.c, opj_jp2_get_tile((), line 2708:

if(p_jp2->color.jp2_cdef) {
    opj_jp2_apply_cdef(p_image, &(p_jp2->color));
}

if(p_jp2->color.jp2_pclr) {
    /* Part 1, I.5.3.4: Either both or none : */
    if( !p_jp2->color.jp2_pclr->cmap)
        opj_jp2_free_pclr(&(p_jp2->color));
    else
        opj_jp2_apply_pclr(p_image, &(p_jp2->color));
}

winfried

Comment #1

Posted on Nov 14, 2014 by Quick Lion

Winfried,

Thanks for pointing this out. I could easily verify this adding -t 0 to opj_decompress command line.

Waiting for other commits before doing anything.

Comment #2

Posted on Nov 15, 2014 by Quick Lion

Patch tested against the whole test suite with no regressions

Attachments

Comment #3

Posted on Nov 17, 2014 by Quick Lion

This issue was closed by revision r2925.

Status: Fixed

Labels:
Type-Defect Priority-Medium