Repository navigation
fix ImageBasedTexture - #159
Merged
Merged
Conversation
png.Reader.asRGBA8() got removed from pypng: https://gitlab.com/drj11/pypng/-/commit/85479eaf5d6152afcfc4d0f3de4188a2174bdf8a Eye.png and NonGeometric.png both have bitdepth 8 so .asRGBA() has the same behaviour
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.
This change fixes an issue with loading PNG files in
ImageBasedTexture.png.Reader.asRGBA8()got removed from pypng: https://gitlab.com/drj11/pypng/-/commit/85479eaf5d6152afcfc4d0f3de4188a2174bdf8a This commit hasn't made it to the pypng wheel on PyPI (still at version 0.20220715.0) which is why I assume maybe it's hard to run into.But the removal is present in this release (version 0.20250521.0) which is what distributions seem to be packaging (Debian, Arch Linux and Nixpkgs at least).
This causes the following:
and the eyeball texture not to render when selected:
So I replaced the call to
.asRGBA8()with one to.asRGBA()and added a check that the bitdepth of the PNG texture file is 8. This is the case for Eye.png andNonGeometric.png, which from what I can tell are the only PNG texture files used within SnapPy.Happy eyeballs: