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:
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user