Skip to content

3 more issues with ktx create and EXR loading #971

@MarkCallow

Description

@MarkCallow

in addition to #966 and #970.

  • .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

ec = LoadEXRImageFromMemory(&image, &header, exrBuffer.data(), exrBuffer.size(), &err);
. https://raw.githubusercontent.com/AcademySoftwareFoundation/openexr-images/main/ScanLines/Blobbies.jpg has lineOrder 1, decreasing Y.

Fixed in 91e61d6.

  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions