Repository navigation
Fix alpha encoding in extended-range PNG snapshots - #281
Closed
pixelmatrix wants to merge 1 commit into
Closed
pixelmatrix wants to merge 1 commit into
pixelmatrix wants to merge 1 commit into
Conversation
Member
|
@pixelmatrix thanks a lot for raising this! I'm looking into adopting your general strategy via #284 and make a few minor tweaks. Out of curiosity, have you filed a feedback for this by chance? It seems quite surprising to me that the "deafult" PNG encoding path would apparently lose color/alpha info like this, so feels like something that should be fixed in the frameworks. Edit: For the record, I filed FB25109021 and opened this dev forum thread to see if this can be addressed at a framework level. |
jamieQ
added a commit
that referenced
this pull request
Oct 8, 2026
Preserve UIImage orientation metadata when exporting through ImageIO. Use small color-aware regression fixtures and a strict expected-failure check to flag a future UIKit alpha fix. Refs #281
jamieQ
added a commit
that referenced
this pull request
Oct 8, 2026
* Fix alpha encoding in extended-range PNG snapshots * fix(png): Preserve orientation and strengthen encoding coverage Preserve UIImage orientation metadata when exporting through ImageIO. Use small color-aware regression fixtures and a strict expected-failure check to flag a future UIKit alpha fix. Refs #281 * test(png): Simplify UIKit alpha canary assertions * test(png): Simplify image encoding regression checks Compare decoded pixels with the source image instead of parsing 16-bit PNG samples. * test(png): Check orientation independently of UIKit metadata --------- Co-authored-by: Josh Pyles <josh@linear.app>
Member
|
Closing in favor of #284. Version |
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.
We were seeing artifacts on partially transparent pixels in our snapshot tests, and after some research, found that
UIImage.pngData()causes this reliably. Exporting using ImageIO does not have the same problem. I've forked this and implemented a fix for us, and wanted to contribute it back, in case it's useful.