diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-11-20 13:16:16 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-11-21 10:11:59 +0200 |
commit | 908bef8eee145408bbf660e873279a978a0acb74 (patch) | |
tree | b517c729cc4eecf06b2bce37e09bb62b320c933a /platform/windows | |
parent | dce1602edacd8ad96a70f29e4f524d7b7c231e3f (diff) |
[Export] Use image loader directly to avoid "resource as image file" errors.
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/export/export_plugin.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/platform/windows/export/export_plugin.cpp b/platform/windows/export/export_plugin.cpp index bfd40e1c9c..f04177d79a 100644 --- a/platform/windows/export/export_plugin.cpp +++ b/platform/windows/export/export_plugin.cpp @@ -31,6 +31,7 @@ #include "export_plugin.h" #include "core/config/project_settings.h" +#include "core/io/image_loader.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" @@ -84,8 +85,10 @@ Error EditorExportPlatformWindows::_process_icon(const Ref<EditorExportPreset> & f->seek(prev_offset); } } else { - Ref<Image> src_image = Image::load_from_file(p_src_path); - ERR_FAIL_COND_V(src_image.is_null() || src_image->is_empty(), ERR_CANT_OPEN); + Ref<Image> src_image; + src_image.instantiate(); + err = ImageLoader::load_image(p_src_path, src_image); + ERR_FAIL_COND_V(err != OK || src_image->is_empty(), ERR_CANT_OPEN); for (size_t i = 0; i < sizeof(icon_size) / sizeof(icon_size[0]); ++i) { int size = (icon_size[i] == 0) ? 256 : icon_size[i]; |