Skip to content

Comments

Set color space in input image prior to resample.#1051

Merged
MarkCallow merged 2 commits intomainfrom
issue1050
Aug 9, 2025
Merged

Set color space in input image prior to resample.#1051
MarkCallow merged 2 commits intomainfrom
issue1050

Conversation

@MarkCallow
Copy link
Collaborator

Fixes #1050.

@aqnuep
Copy link
Collaborator

aqnuep commented Aug 8, 2025

@MarkCallow, we did not implement scaling, so I have no idea whether this is the right order of operations, therefore I'm not sure I can provide an informed review of this without understanding the details how scaling was added.

@MarkCallow
Copy link
Collaborator Author

@MarkCallow, we did not implement scaling, so I have no idea whether this is the right order of operations, therefore I'm not sure I can provide an informed review of this without understanding the details how scaling was added.

Thanks for looking. --generate-mipmap is also affected by this bug as both it and --scale use the resample method to resize images. Not having the color space set before scaleImage and generateMipLevels are called results in Image::resample always seeing _UNSPECIFIED and so never decoding sRGB images. The color space must be set before these functions are called. I am confident this is the correct order so I am going to merge this.

I am not too surprised the issue was missed when the --generate-mipmap tests were added as the differences between correct and incorrect images are very subtle.

@MarkCallow MarkCallow merged commit 1daca0c into main Aug 9, 2025
37 checks passed
@MarkCallow MarkCallow deleted the issue1050 branch August 9, 2025 05:03
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.

Resampling, when called from ktx create, not decoding sRGB images

2 participants