Pillow
Pillow copied to clipboard
Enhancement request: JPEG2000 w/ metadata
It would be great if we were able to optionally write XML metadata to JPEG2000 images. Currently unsupported.
That is something that would be a good addition. PRs welcome.
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.