Skip to content

feat(image): add Image Dimensions - #158

Merged
hateofhades merged 1 commit into
mainfrom
feat/120-image-dimensions
Sep 5, 2026
Merged

feat(image): add Image Dimensions#158
hateofhades merged 1 commit into
mainfrom
feat/120-image-dimensions

Conversation

@hateofhades

@hateofhades hateofhades commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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:

  • 1920 × 1080 reduces to 16:9. Print it.
  • 4001 × 2250 reduces to nothing anybody recognises, but is 16:9 to anyone looking at it. It gets ≈ 16:9 — named after the shape it is within one percent of, with the ≈ doing the honesty.
  • 1000 × 337 is near no common shape at all. It gets 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 flowlessToolSlugs beside the PDF viewer rather than being given a pass-through contract it does not have. AGENTS.md describes this exact case, and hasCompleteFlowContracts still guards every other Gizlet.

Checks

pnpm run check, pnpm test (497), pnpm run build and pnpm 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) and tests/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 main in parallel (#156, #157). They touch the registry, the related-Gizlet map and the regenerated gizlets.png; whichever lands last needs a rebase, and the conflicts are additions next to each other.

Screenshot

dimensions-report

@hateofhades
hateofhades force-pushed the feat/120-image-dimensions branch from e74543b to 8b55927 Compare September 5, 2026 19:16
@hateofhades
hateofhades merged commit a47d364 into main Sep 5, 2026
2 checks passed
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.

feat(image): add Image Dimensions Inspector

1 participant