From 84904da07ad95f70f08d2f2b715c2b0ca76b547e 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: [PATCH] [Export] Use image loader directly to avoid "resource as image file" errors. (cherry picked from commit 908bef8eee145408bbf660e873279a978a0acb74) --- platform/iphone/export/export.cpp | 6 +++--- platform/osx/export/export.cpp | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index c4789374184..39cf065d541 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -947,7 +947,7 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Ref image; String image_path = p_dest_dir.plus_file("splash@2x.png"); image.instance(); - Error err = image->load(custom_launch_image_2x); + Error err = ImageLoader::load_image(custom_launch_image_2x, image); if (err) { image.unref(); @@ -961,7 +961,7 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Refload(custom_launch_image_3x); + err = ImageLoader::load_image(custom_launch_image_3x, image); if (err) { image.unref(); @@ -978,7 +978,7 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Refload(splash_path); + const Error err = ImageLoader::load_image(splash_path, splash); if (err) { splash.unref(); } diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index efbfe2447bc..ffe77ff7716 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -31,6 +31,7 @@ #include "export.h" #include "codesign.h" +#include "core/io/image_loader.h" #include "core/io/marshalls.h" #include "core/io/resource_saver.h" #include "core/io/zip_io.h" @@ -1180,8 +1181,8 @@ Error EditorExportPlatformOSX::export_project(const Ref &p_p } else { Ref icon; icon.instance(); - icon->load(iconpath); - if (!icon->empty()) { + err = ImageLoader::load_image(iconpath, icon); + if (err == OK && !icon->empty()) { _make_icon(p_preset, icon, data); } }