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

@ -152,7 +152,7 @@ Error image_to_png(const Ref<Image> &p_image, Vector<uint8_t> &p_buffer) {
png_img.format = PNG_FORMAT_RGBA;
break;
default:
if (source_image->detect_alpha()) {
if (source_image->detect_alpha() != Image::ALPHA_NONE) {
source_image->convert(Image::FORMAT_RGBA8);
png_img.format = PNG_FORMAT_RGBA;
} else {