You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keep an undecoded maker note's pointer past the image valid on a length-changing edit #166
After #153, a maker note that the editor can't decode (#164) may still hold a pointer to bytes after the JPEG EOI or the PNG IEND. A length-changing edit moves those bytes, as exiftool does, so the pointer then names different bytes. #153 accepts this to match exiftool. No real file in the test corpus has an undecoded note with such a pointer, apart from the Sony files covered by #163.
The repro is the input of Comment_OfAJpegWithAnUnlocatedNoteAndATrailer_IsSaved.
Proposed solution
Once #164 decodes the layout, the pointer is rewritten by #163's delta. For notes that still can't be decoded, consider refusing a length-changing edit when there are bytes after the image. Notes that carry their own TIFF header use note-relative offsets and can't name the trailer, so they need no refusal.
Context
This is a follow-up to #153 and part of #111. It depends on #163 and #164.
changed the title [-]Refuse an edit that moves bytes after the image that an unread maker note names[/-][+]Keep an undecoded maker note's pointer past the image valid on a length-changing edit[/+]on Nov 29, 2026
Activity
[-]Refuse an edit that moves bytes after the image that an unread maker note names[/-][+]Keep an undecoded maker note's pointer past the image valid on a length-changing edit[/+]