Skip to content

API breakage in 2.5.1 / openjpeg version no longer detected (openjpeg.h no longer includes opj_config.h) #1514

@0-wiz-0

Description

@0-wiz-0

Despite

No API/ABI break compared to v2.5.0

in the 2.5.1 release notes, an upgrade to 2.5.1 in pkgsrc broke some other software.

Two examples:
Pillow

src/libImaging/Jpeg2KDecode.c: In function 'j2k_decode_entry':
src/libImaging/Jpeg2KDecode.c:673:5: error: too few arguments to function 'opj_stream_set_user_data'
  673 |     opj_stream_set_user_data(stream, state);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/libImaging/Jpeg2K.h:11,
                 from src/libImaging/Jpeg2KDecode.c:21:
/home/pbulk/build/graphics/py-Pillow/work/.buildlink/include/openjpeg-2.5/openjpeg.h:1235:27: note: declared here
 1235 | OPJ_API void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream,
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~

ghostscript

./base/sjpx_openjpeg.c: In function 's_opjd_process':
./base/sjpx_openjpeg.c:760:5: warning: "OPJ_VERSION_MAJOR" is not defined, evaluates to 0 [-Wundef]
  760 | #if OPJ_VERSION_MAJOR >= 2 && OPJ_VERSION_MINOR >= 1
      |     ^~~~~~~~~~~~~~~~~
./base/sjpx_openjpeg.c:763:13: error: too few arguments to function 'opj_stream_set_user_data'
  763 |             opj_stream_set_user_data(state->stream, &(state->sb));
      |             ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./base/sjpx_openjpeg.h:25,
                 from ./base/sjpx_openjpeg.c:24:
/home/pbulk/build/print/ghostscript-agpl/work/.buildlink/include/openjpeg-2.5/openjpeg.h:1235:27: note: declared here
 1235 | OPJ_API void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream,
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~

I guess the software used some now invalid way to check for openjpeg versions, e.g. Pillow

/* OpenJPEG 2.0 doesn't have OPJ_VERSION_MAJOR */
#ifndef OPJ_VERSION_MAJOR
    opj_stream_set_user_data(stream, state);
#else
     opj_stream_set_user_data(stream, state, NULL);
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions