KhronosGroup / KTX-Software

KTX (Khronos Texture) Library and Tools
Other
854 stars 226 forks source link

Error using ktx create --assign-primaries none #836

Closed Makio64 closed 7 months ago

Makio64 commented 7 months ago

On windows11 when i'm using the command : ktx create --format R8G8B8_UNORM --encode uastc --normal-mode --input-swizzle rgb1 --assign-oetf linear --assign-primaries none outputPath inputPath

i got ktx create fatal: Invalid or unsupported transfer function specified as --assign-primaries argument: "NONE".

The toktx commands toktx --encode uastc --normal_mode --input_swizzle rgb1 --assign_oetf linear --assign_primaries none outputPath inputPath works fine.

none seems to be converted to NONE and make the command fail as its case sensitive.

MarkCallow commented 7 months ago

I'm struggling to see how this could happen. The option's argument is converted to upper at the start of parsing and the lookup table has the key "NONE". @Makio64 did you have a typo in your command that is not reflected above, e.g. passing "none" to --assign-oetf? Given the error I'll note in the next paragraph, such a mistake is non-obvious.

@aqnuep the error message string in parseColorPrimaries says "transfer function". Please fix that and offer any other insight you may have into how the reported error is possible.

aqnuep commented 7 months ago

I've created PR #837 to fix the error message typo (and also changing the output to print the original form of the parameter).

However, I cannot reproduce the error on --assign-primaries none. @Makio64, are you using code from the main branch or from an earlier release? If you're not using the code from main then you'll likely using code that did not have the "none" option, as it was introduced fairly recently.

@MarkCallow, I think the project deserves an issue template where people could also state what version of the tool they're using, because far too often the underlying cause is simply using an out-of-date version.

Makio64 commented 7 months ago

@aqnuep I didn’t recompile myself but im using the latest release beta version, windows 11 x64

aqnuep commented 7 months ago

@MarkCallow will know better, but I believe even the latest beta release is too old to include support for --assign-primaries none.

MarkCallow commented 7 months ago

v4.3.0-beta1 does have support for --assign-primaries none. I just confirmed it by checking out the tag, compiling and testing it. @Makio64 please copy and paste the exact command line you are using that fails.

MarkCallow commented 7 months ago

We are unable to reproduce. @Makio64 if you can reproduce in 4.3.0-beta1 please copy and paste the exact command here.