Skip to content

fix(magic): a jpeg opens with any segment - #1469

Merged
andiwand merged 1 commit into
mainfrom
fix/jpeg-first-segment
Dec 4, 2026
Merged

andiwand merged 1 commit into
mainfrom
fix/jpeg-first-segment

Conversation

@andiwand

@andiwand andiwand commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

A jpeg was only recognized if it started with one of four segments. One that starts with an ICC profile, Photoshop data or XMP gave UnknownFileType, though it opened when asked for as a jpeg.

Detection now accepts any file starting with FF D8 FF: the start of a jpeg and the first byte of whichever segment follows. A new test covers JFIF, XMP, ICC and Photoshop. I ran the detection, image and media tests, not the full suite.

Reported from OpenDocument.droid, which works around it in opendocument-app/OpenDocument.droid#791.

Only a few first segments were recognized, so a jpeg that starts with an ICC
profile, Photoshop data or XMP had no file type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FW6WZXAWPwKbkkxah8iPGp
@andiwand
andiwand force-pushed the fix/jpeg-first-segment branch from ed49745 to 93f7bfa Compare December 4, 2026 13:47
@andiwand
andiwand merged commit 5e32258 into main Dec 4, 2026
21 of 22 checks passed
@andiwand
andiwand deleted the fix/jpeg-first-segment branch December 4, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant