Skip to content

Conversation

MarkCallow
Copy link
Collaborator

@MarkCallow MarkCallow commented Mar 25, 2025

Missing functionality from the legacy tool added so we can comfortably remove the legacy tools in 4.5.

The following issues were discovered and fixed while adding the features:

  • The target imageSpec was being updated for every input file. This was only working because, until now, nothing had looked at the spec values that were being changed once the texture had been created. The fix is to make separate determineSourceColorSpace and determineTargetColorSpace functions.
  • An associated fix to the above is to move the checks for non-null transferFunctions to the use site with fatal errors thrown then if they are null. This avoids the need for second guessing to avoid the fatal errors when the transferFunctions will not be used. With this and the above fix, the code is now much more robust and clear.
  • Full help was missing --levels.
  • Full help had an incorrect statement regarding implicit color conversions dating from the transfer function work.

Add matching origin checks to checkSpecsMatch.
A simplification that removes the need to avoid unnecessary fatal errors.
This completes the rewrite to prevent the target spec. being updated
when subsequent files are loaded.
Scale and resize are now implemented and all existing tests pass.
The only changes to the tests are for updated messages. No generated
.ktx2 files have been changed.
Fix: do not update target spec on subsequent input file reads.

Things were only working because no code after the ktxTexture2 is
created was dependent on the values in the target image spec.
Upcoming work needs those values.
…known.

Add --levels to help.

Improve error messages.
@CLAassistant
Copy link

CLAassistant commented Mar 25, 2025

CLA assistant check
All committers have signed the CLA.

@MarkCallow MarkCallow merged commit 7aeccc0 into main Mar 26, 2025
20 checks passed
MarkCallow added a commit that referenced this pull request Mar 26, 2025
Missing functionality from the legacy tool added so we can comfortably remove the legacy tools in 4.5.

The following issues were discovered and fixed while adding the features:

* The target imageSpec was being updated for every input file. This
  was only working because, until now, nothing had looked at the spec
  values that were being changed once the texture had been created.
  The fix is to make separate determineSourceColorSpace and
  determineTargetColorSpace functions.
* An associated fix to the above is to move the checks for non-null
  transferFunctions to the use site with fatal errors thrown then if
  they are null. This avoids the need for second guessing to avoid
  the fatal errors when the transferFunctions will not be used. With
  this and the above fix, the code is now much more robust and clear.
* Full help was missing --levels.
* Full help had an incorrect statement regarding implicit color
  conversions dating from the transfer function work.
@MarkCallow MarkCallow deleted the create_scale branch March 26, 2025 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants