Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

Enhancement request: JPEG2000 w/ metadata

Open johnfrancisgit opened this issue 6 years ago • 2 comments

It would be great if we were able to optionally write XML metadata to JPEG2000 images. Currently unsupported.

johnfrancisgit avatar Mar 19 '18 12:03 johnfrancisgit

That is something that would be a good addition. PRs welcome.

wiredfool avatar Mar 22 '18 07:03 wiredfool

Looking at page 21 of https://web.archive.org/web/20230327234610/https://wiki.opf-labs.org/download/attachments/11337762/15444-1annexi.pdf, the XML box comes after the JP2 Header.

Looking at https://github.com/uclouvain/openjpeg/blob/6a29f5a9e3a1e2dbf1e3df22b7e449bc1db20b5c/src/lib/openjp2/jp2.c#L2916-L2949 and https://exiftool.org/TagNames/Jpeg2000.html, I conclude that this is a missing OpenJPEG feature. I think the solution is to create opj_jp2_write_xml in OpenJPEG, adding it to opj_jp2_setup_header_writing.

Although given that work to allow OpenJPEG to read XML has stalled, that may not happen anytime soon.

radarhere avatar Apr 14 '21 13:04 radarhere