Repository navigation
pixel-peeper: rotate HIF sources too, and decode via TIFF - #396
Merged
Merged
Conversation
Two things in load_source, one a bug and one a speed knob. exif_transpose sat in the else arm alone, so a JPG source was cropped from the upright frame and a HIF from the unrotated one. Ten of the eighteen trial sources are rotated HIFs, so most of the set was cropped out of a sideways image. Measured on XT509509: (7728, 5152) before, (5152, 7728) after, while XT507494 (a rotated JPG) was already upright. The decode reads TIFF rather than PNG. Both are lossless and sips writes the same pixels either way; PNG spends its time deflating an intermediate that is deleted a moment later. Over four sources: 7.47s to 1.25s. Worth knowing why the rotation is now explicit in both arms rather than left to the format. Pillow applies the orientation hint itself when it loads a TIFF and does NOT when it loads a PNG, so the format swap alone would have fixed the bug by accident and hidden the reason. sips is consistent here, contrary to first appearances: it preserves the tag and leaves pixels stored-order for png, tiff and jpeg alike. NOT rebuilt. The trial set is curated and a rebuild would change the ten HIF-sourced crops, which is a content decision rather than a fix.
Contributor
Wire-size diff vs merge base
Brotli q11, the quality the edge serves. Every number here is deterministic: Client assetsNo change. 20 files, 73.98 KiB Brotli total. PagesNo change. 48 files, 496.67 KiB Brotli total. Worker bundleNo change. 284.68 KiB gzip. Dictionary deltas (
|
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
aadhar-sh | 01bf0cb | Aug 15 2026, 03:37 AM |
oddharsh
added a commit
that referenced
this pull request
Aug 15, 2026
#396 fixed load_source so a HIF is rotated before cropping, and ten of the eighteen trial sources are rotated HIFs, so most of the set had been cut out of a sideways frame. This is that fix reaching the page. 18 trials kept of 31 built: chroma 1, encoder 6, quality 8, tradeoff 3 16 of 18 carry the same axis and source as before; the crops moved 50 tiles, 901 KB worst equal-budget drift shipped: 1.84% 28 candidates dropped, each with its reason logged The drops are the generator working rather than a loss: most are chroma trials where 4:2:0 costs so little that no one could see the difference, and a trial nobody can call is not a test. Same rule that rejected the original set's unequal-byte encoder comparison. Manifest and tiles verified in bijection, 50 named and 50 on disk, none missing and none orphaned.
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.
Two things in load_source, one a bug and one a speed knob.
exif_transpose sat in the else arm alone, so a JPG source was cropped from
the upright frame and a HIF from the unrotated one. Ten of the eighteen
trial sources are rotated HIFs, so most of the set was cropped out of a
sideways image. Measured on XT509509: (7728, 5152) before, (5152, 7728)
after, while XT507494 (a rotated JPG) was already upright.
The decode reads TIFF rather than PNG. Both are lossless and sips writes
the same pixels either way; PNG spends its time deflating an intermediate
that is deleted a moment later. Over four sources: 7.47s to 1.25s.
Worth knowing why the rotation is now explicit in both arms rather than
left to the format. Pillow applies the orientation hint itself when it
loads a TIFF and does NOT when it loads a PNG, so the format swap alone
would have fixed the bug by accident and hidden the reason. sips is
consistent here, contrary to first appearances: it preserves the tag and
leaves pixels stored-order for png, tiff and jpeg alike.
NOT rebuilt. The trial set is curated and a rebuild would change the ten
HIF-sourced crops, which is a content decision rather than a fix.