From 908bef8eee145408bbf660e873279a978a0acb74 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sun, 20 Nov 2022 13:16:16 +0200 Subject: [Export] Use image loader directly to avoid "resource as image file" errors. --- platform/windows/export/export_plugin.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'platform/windows') 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 & f->seek(prev_offset); } } else { - Ref 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 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]; -- cgit v1.2.3