InsightSoftwareConsortium / InsightSoftwareConsortium/ITK

[ITK 5.1] itkJPEG2000ImageIO.cxx pulls in private openjpeg headers and uses wrong enumss

Open
#1,807 4 comments 0 reactions 0 assignees View on GitHub
status:Use_Milestone_Backlog type:Bug
Dominant language
C++
Stars
1.7k
Forks
748
Avg merge
1d 1h
Merged PRs (30d)
64

Description

### Description
https://github.com/InsightSoftwareConsortium/ITK/blob/7900a8b6d63ec8201405eff3b46c8d2a4e563c45/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx#L29-L31
header `jk2.h` and `jp2.h` are not getting installed by OpenJPEG. As such symbols like `CODEC_` are not available. Remove the private headers and include only `openjpeg.h` and replace `CODEC_` with `OPJ_CODEC_` (same for the `CLRSPC` enums values)

Furthermore `opj_stream_create_default_file_stream` does not accept a filehandle any more.
https://github.com/uclouvain/openjpeg/blob/57096325457f96d8cd07bd3af04fe81d7a2ba788/src/lib/openjp2/openjpeg.h#L1212-L1213
http://www.openjpeg.org/doxygen/openjpeg_8c.html#acb36a77efa64f8332c27fc4ea6be066c

In general the OpenJPEG API seems to have changed quite a bit in the meantime (using 2.3.1)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.