Skip to content

Add ImageType.jpeg read capability and magic-byte detection - #42

Merged
germ-mark merged 1 commit into
mainfrom
llm/imagetype-jpeg-read
Jul 22, 2026
Merged

Add ImageType.jpeg read capability and magic-byte detection#42
germ-mark merged 1 commit into
mainfrom
llm/imagetype-jpeg-read

Conversation

@germ-mark

Copy link
Copy Markdown
Contributor

Adds case jpeg = 2 to ImageType, plus ImageType.detect(from:) which classifies image bytes by magic number (JXL codestream, JXL container, JPEG). This is read capability only — no writer emits .jpeg.

Senders without a JPEG XL encoder (the App Clip, which drops libjxl to cut binary size) will keep labeling their JPEG bytes .jpegXL, because DescribedImage sits inside the signed CoreIdentity quintuple and decode is fail-closed: an unknown discriminant aborts the entire identity/welcome parse on deployed clients rather than degrading to a card without an image. Landing the reader now means a future release can make the label honest once readers are widely deployed; until then consumers should classify by bytes via detect(from:) rather than trusting the wire label.

🤖 Generated with Claude Code

No writer emits .jpeg yet: senders without a JPEG XL encoder (the App
Clip) keep labeling JPEG bytes .jpegXL, because deployed clients fail
the entire signed CoreIdentity parse on an unknown discriminant.
Consumers classify by bytes via ImageType.detect(from:), not the label.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 28b7337

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@germ-network/autonomous-comm-protocol Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@germ-mark
germ-mark merged commit d1cbb3d into main Jul 22, 2026
8 checks passed
@germ-mark
germ-mark deleted the llm/imagetype-jpeg-read branch July 22, 2026 22:50
@github-actions github-actions Bot mentioned this pull request Jul 22, 2026
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