Repository navigation
Metadata for every format - #56
Merged
Merged
Conversation
All encoders take the metadata `encode()` takes for PNGs (`Metadata`, `PNGMetadata` stays as a deprecated alias), each format stores the fields it has a place for: - JPEG: Exif (APP1) and a comment marker - WebP: Exif (the extended format's EXIF chunk), still and animated - GIF: comment extensions - TGA: the TGA 2.0 extension area - APNG: text chunks, like PNG The defaults are the same everywhere: the creation time and ImageScript with its version as the software (`software: ''` leaves it out). PNG text that isn't Latin-1 goes into iTXt chunks as UTF-8 instead of tEXt, and the text chunks come before the image data. An invalid creation time throws instead of writing "Invalid Date". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ljnxm1Qjrocq1izGajLx8J
matmen
force-pushed
the
encode-metadata
branch
from
October 15, 2026 14:53
56597ef to
0305965
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All encoders now take the metadata
encode()takes for PNGs. The interface is now calledMetadata,PNGMetadatastays as a deprecated alias until 4.0.Each format stores the fields it has a place for:
EXIFchunk, extended format)Defaults
The defaults are the same for every format: the creation time, and ImageScript with its version as the software.
{software: ''}leaves the software out.Size added to each file: about 40 bytes for GIF, about 200 for JPEG and WebP, 495 for TGA (the extension area has a fixed size).
Fixes
tEXt, which is Latin-1, so readers showed it garbled. It now goes intoiTXtchunks as UTF-8.creationTimethrows aRangeErrorinstead of writing "Invalid Date".Testing
tests/metadata.js.