1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Explicitly handle Image AlphaMode enum instead of treating as bool

Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
This commit is contained in:
Aaron Franke
2025-04-24 10:41:07 -07:00
parent be3ecaeb3c
commit 19e6bc68aa
3 changed files with 3 additions and 3 deletions

View File

@@ -60,7 +60,7 @@ Vector<uint8_t> _webp_packer(const Ref<Image> &p_image, float p_quality, bool p_
Error error = img->decompress();
ERR_FAIL_COND_V_MSG(error != OK, Vector<uint8_t>(), "Couldn't decompress image.");
}
if (img->detect_alpha()) {
if (img->detect_alpha() != Image::ALPHA_NONE) {
img->convert(Image::FORMAT_RGBA8);
} else {
img->convert(Image::FORMAT_RGB8);