Fix crash in ResourceImporterTexture::_save_stex if webp disabled
Fixes #51535.
(cherry picked from commit 79d4edfca7
)
This commit is contained in:
parent
e4996887ca
commit
44a532e99e
1 changed files with 2 additions and 1 deletions
|
@ -256,7 +256,8 @@ void ResourceImporterTexture::_save_stex(const Ref<Image> &p_image, const String
|
|||
|
||||
switch (p_compress_mode) {
|
||||
case COMPRESS_LOSSLESS: {
|
||||
bool lossless_force_png = ProjectSettings::get_singleton()->get("rendering/misc/lossless_compression/force_png");
|
||||
bool lossless_force_png = ProjectSettings::get_singleton()->get("rendering/misc/lossless_compression/force_png") ||
|
||||
!Image::_webp_mem_loader_func; // WebP module disabled.
|
||||
bool use_webp = !lossless_force_png && p_image->get_width() <= 16383 && p_image->get_height() <= 16383; // WebP has a size limit
|
||||
Ref<Image> image = p_image->duplicate();
|
||||
if (p_mipmaps) {
|
||||
|
|
Loading…
Reference in a new issue