feat(image): add Image Dimensions - #158
Merged
Merged
Conversation
hateofhades
force-pushed
the
feat/120-image-dimensions
branch
from
September 5, 2026 19:16
e74543b to
8b55927
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.
Closes #120.
The sixth Gizlet of roadmap phase 2, and the smallest one on the site. The registry entry flips to available with an agent block, it declares itself flowless, gains a related-Gizlet key, a social card and page copy, and its bench row goes.
What it does
Drop a picture in and read: pixel dimensions, aspect ratio, megapixels, shape, format detected from the file itself, and file size. It writes nothing — there is not even a download, because nothing was made.
The dimensions, the ratio and each side on its own carry a copy button. "Landscape" does not: nobody pastes that into a form, and a copy button beside every row would make the two that matter harder to find.
The aspect ratio is the only real decision
Three cases, and printing the raw reduction handles only the first:
16:9. Print it.≈ 16:9— named after the shape it is within one percent of, with the ≈ doing the honesty.2.97:1, because a ratio nobody could use would be technically true and practically useless.No flow contract, deliberately
It shows the visitor something and produces nothing another Gizlet could take, so it joins
flowlessToolSlugsbeside the PDF viewer rather than being given a pass-through contract it does not have.AGENTS.mddescribes this exact case, andhasCompleteFlowContractsstill guards every other Gizlet.Checks
pnpm run check,pnpm test(497),pnpm run buildandpnpm run test:e2e(117) all pass. New coverage:tests/unit/image-dimensions.test.ts(the three ratio cases, megapixel rounding at both ends, the shape and format labels, which rows are copyable) andtests/e2e/image-dimensions.spec.ts(measure, copy to a real clipboard and read it back, a non-image and a file that lies about being one).Note for whoever merges
This is one of several image Gizlets cut from
mainin parallel (#156, #157). They touch the registry, the related-Gizlet map and the regeneratedgizlets.png; whichever lands last needs a rebase, and the conflicts are additions next to each other.Screenshot