Closed dloebl closed 3 months ago
Thanks for the report and the test file.
Since you've done much of the groundwork and a reproducer, would you be willing to debug further (should be in JpegBase::doWriteMetadata()
) and propose a patch?
Never mind, think I've found it, but need help wrapping it up...
Thank you for addressing this issue so quickly, @kmilos! I can confirm that #2989 has resolved the issue
Describe the bug
Adding EXIF metadata causes some JPEGs to become invalid: If the input JPEG has an empty JPEG marker section, an invalid marker is written:
Input JPEG:
00 02
is the length of the marker excluding theff e1
bytes (so it's effectively empty).Adding EXIF metadata causes the JPEG to become invalid.
Output JPEG:
00 00
isn't a valid length for a JPEG marker, so the file is invalid and fails to render in some browsers (most notably Safari).To Reproduce
test.jpg
Before:
After:
Expected behavior
The JPEG should be valid after adding EXIF metadata.
Desktop: