KhronosGroup / KhronosGroup/KTX-Software

ktx create not doing verbatim copy of EXR half_float. Also "Not enough precision" error message is unclear.

Open
#970 3 comments 0 reactions 1 assignee Assigned to @MarkCallow View on GitHub
Dominant language
C++
Stars
1.4k
Forks
317
Avg merge
20h 12m
Merged PRs (30d)
3

Description

When loading an EXR file with half float channels and `--format R32B32B32A32_SFLOAT` ktx create raises an error

```
Not enough precision to convert 16 bit input to 32 bit output for R32B32B32A32_SFLOAT.
```
However ExrInput::ReadImage happily accepts a targetBitDepth of 32 which it passes on to `LoadEXRImageFromMemory` which returns float values. If I comment out this code https://github.com/KhronosGroup/KTX-Software/blob/b6190046bbf71e0fbf9e7a964f6ee39d726b16be/tools/ktx/command_create.cpp#L1406 where the error is raised then ktx create successfully creates the texture. So two questions:

1. Why is it attempting to convert to float when it already has float? It requested float and received float.
2. "Not enough precision"? TinyEXR is managing to do the conversion. Is this poor error message wording and ktx create simply does not implement such conversions?

The half-float file I've been using for testing is https://raw.githubusercontent.com/AcademySoftwareFoundation/openexr-images/main/ScanLines/Blobbies.jpg.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.