KTX-Software
KTX-Software copied to clipboard
3 more issues with ktx create and EXR loading
in addition to #966 and #970.
- [x] .exr files with lineOrder != 0 are being loaded with the image upside down. This is due to a bug or feature in TinyEXR (see https://github.com/syoyo/tinyexr/issues/213) and can be worked around, at least with the files tested so far, by adding the line
header.line_order = 0;
before https://github.com/KhronosGroup/KTX-Software/blob/b6190046bbf71e0fbf9e7a964f6ee39d726b16be/tools/imageio/exr.imageio/exrinput.cc#L227. https://raw.githubusercontent.com/AcademySoftwareFoundation/openexr-images/main/ScanLines/Blobbies.jpg has lineOrder 1, decreasing Y.
Fixed in https://github.com/KhronosGroup/KTX-Software/commit/91e61d6fa3f06eb8616fc2eba74fba7703e4fe11.
- [ ] If the .exr file contains no recognized channels ktx create creates an empty texture. It should raise an error. Only R,G,B and A are currently recognized.
- [ ] A single channel "Y" should be recognized and a greyscale texture created. Probably handling should follow the same model as PNG L textures which IIRC is to replicate the channel to all 3 if the output format is RGB{,A} or add swizzle metadata if the output format is R. The EXR spec does not specifically call out YA textures so it is unclear if those exist and should be supported. For now only supporting only Y is good. A .exr with a single Y channel is https://raw.githubusercontent.com/AcademySoftwareFoundation/openexr-images/main/LuminanceChroma/Garden.exr.