Repository navigation
fix(cli): respect image orientation in capture contact sheets - #5295
Merged
jrusso1020 merged 1 commit intoOct 24, 2026
Merged
jrusso1020 merged 1 commit into
jrusso1020 merged 1 commit into
Conversation
5 tasks done
jrusso1020
approved these changes
Oct 24, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Confirmed on main that createContactSheet sizes cells from raw metadata width and height and resizes without orienting, so EXIF-rotated photos land sideways in the asset contact sheet. Using metadata().autoOrient for the first cell's dimensions and calling autoOrient() before each resize fixes both the cell shape and every thumbnail, and it is a no-op for the PNG screenshot sheets that share this function. Both APIs exist in the pinned sharp 0.35. The tests build a quadrant-colored JPEG for all eight orientations and check pixel placement, plus a mixed-orientation asset sheet where only the second image is rotated, so they exercise the real path. Still relevant on main.
— Rames
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.
What
Respect EXIF orientation in downloaded-asset contact sheets: use displayed dimensions for the grid and orient every thumbnail before resizing.
Why
hyperframes capturedownloads an EXIF-oriented portrait correctly and screenshots the page upright, but its asset contact sheet displays the same photo sideways. Reproduced on main with Portrait_6.jpg: coded dimensions are 1800×1200, displayed dimensions are 1200×1800. The generated sheet changes from 1940×354 with a sideways photo to 1940×754 with an upright photo.Related work
No overlapping capture contact-sheet orientation issue or PR found. #5288 addresses orientation in reference-image comparisons; this fixes the separate asset-preview generation path.
How
Read Sharp's auto-oriented metadata for the first cell's aspect ratio and apply
autoOrient()before each resize. Downloaded image bytes remain unchanged.Test plan