Repository navigation
Preserve EXIF subdirectories in compressed TIFFs - #10470
harshitdeora wants to merge 4 commits into
Conversation
|
I have merged #10461, in case you would like to do anything based on that. I will also point out that there is a Lint failure at the moment. |
|
Fixed the mypy failure in |
Hi @harshitdeora, @radarhere suggested combining my PR #10560 with yours because they address the same compressed-TIFF metadata issue. Would you be open to incorporating the additional regression tests and any missing edge-case handling from my PR? I can test them against your branch and share a focused patch. |
Addresses the compressed TIFF case in #10460. The uncompressed case is tracked separately in #10461.
Saving a JPEG's EXIF metadata into a compressed TIFF passes a subdirectory dictionary to LibTIFF's offset field and raises
RuntimeError: Error setting from dictionary. Serialize the subdirectories with Pillow's existing IFD writer, place them after the ClassicTIFF header, and give LibTIFF their destination offsets. For multipage TIFFs the main directory pointer is rebased when the page is appended.The regression covers file paths and memory buffers, LZW and Adobe Deflate, and single and multiple pages. It checks the pixels and verifies that EXIF, GPS, and the nested interoperability directory can be read back.
Validation on Linux / CPython 3.12
4d01b943and pass on this branch with LibTIFF 4.7.2.