-
Notifications
You must be signed in to change notification settings - Fork 3
enable etcpakcodec on linux and tex2img on windows #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…ecause etcpak segafults on windows, but tex2img segfaults on linux
|
|
After looking over it: The segfault happens after all tests are done and the interpreter is garbage collecting during shutting down. |
| actual = CODEC.decompress(compressed, CompressionFormat.ETC1, expected.width, expected.height, None) \ | ||
| .convert(expected.mode) | ||
| for coords in zip(range(expected.width), range(expected.height)): | ||
| assert expected.getpixel(coords) == actual.getpixel(coords) # type: ignore[reportUnknownMemberType] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we swap the bytes at decompression. this is not accounted for in this test.
I assume the pixel order in the compressed is wrong since the swapping to BGR is not actually mandated by the ETC standart. It seems to be just an implementation flavor of etcpak. I think this fails since AEI_Editor also doesn't swap the color channels which suggests that .aei actually stores ETC1 in RGB instead of BGR. But i am not entirely sure.
| assert expected.getpixel(coords) == actual.getpixel(coords) # type: ignore[reportUnknownMemberType] | |
| pixel = actual.getpixel(coords) | |
| assert expected.getpixel(coords) == (pixel[2],pixel[1],pixel[0]) # type: ignore[reportUnknownMemberType] |
| def test_decompress_ETC1_succeeds_onLinux(): | ||
| with smileyRoundtripImage(CompressionFormat.ETC1) as expected: | ||
| compressed = SMILEY_COMPRESSED_RAW[CompressionFormat.ETC1] | ||
| actual = CODEC.decompress(compressed, CompressionFormat.ETC1, expected.width, expected.height, None) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The size is to large. the data size is width * height but etcpak expects width * height // 2
| actual = CODEC.decompress(compressed, CompressionFormat.ETC1, expected.width, expected.height, None) \ | |
| actual = CODEC.decompress(compressed[:expected.width * expected.height //2], CompressionFormat.ETC1, expected.width, expected.height, None) |
|



Notes for reviewer:
notOnPlatformsparameter tosupportsFormatsgetCompressedImageLengthmethod onImageCodecAdaptor