Repository navigation
Conversation
Full-page captures resized the viewport to the document height before taking the screenshot, so a 100vh section grew to fill the whole image and the rest of the page fell off the bottom. Chromiumoxide's full_page option, used for pages past the Retina limit, resizes it the same way. Clip the whole document with captureBeyondViewport instead. The clip keeps the device scale factor, so full pages stay at 2x up to the existing ~16k px limit and fall back to 1x past it. Settle every image in the document before the screenshot, which the resized viewport used to do implicitly. Assisted-by: Claude Opus 5.5
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.
full-page captures resized the viewport to the page height before taking the screenshot, so a
100vhsection grew to fill the whole image. on a 320×240 page that starts with a full-height blue header,iris --fullcame back solid blue and everything under the header was cut off. now the viewport stays at the requested size and the screenshot clips the whole document, still at 2x up to chrome's ~16k px limit and 1x past it.cargo test full_page_capture_keeps_viewport_relative_heightsfails on main (the row right under the header is still blue) and passes with this change. the test reads pixels with thepngcrate, added as a dev-dependency.