diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-21 11:43:44 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-21 11:43:44 +0100 |
commit | 7adfd1dbe6d9fa6ce3c0839536a0059d37321d14 (patch) | |
tree | acc1479bd68f14c345293f85ec4698c5cd1a50f2 /platform/macos/export/export_plugin.cpp | |
parent | d0b4cca7a6ff0b752689f1ab1b66e135158a062a (diff) | |
parent | 908bef8eee145408bbf660e873279a978a0acb74 (diff) |
Merge pull request #68916 from bruvzg/no_img_error
[Export] Use image loader directly to avoid "resource as image file" errors.
Diffstat (limited to 'platform/macos/export/export_plugin.cpp')
-rw-r--r-- | platform/macos/export/export_plugin.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index ae8c802caf..5860a4f0ae 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -34,6 +34,7 @@ #include "lipo.h" #include "macho.h" +#include "core/io/image_loader.h" #include "core/string/translation.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" @@ -1269,8 +1270,10 @@ Error EditorExportPlatformMacOS::export_project(const Ref<EditorExportPreset> &p icon->get_buffer(&data.write[0], icon->get_length()); } } else { - Ref<Image> icon = Image::load_from_file(iconpath); - if (icon.is_valid() && !icon->is_empty()) { + Ref<Image> icon; + icon.instantiate(); + err = ImageLoader::load_image(iconpath, icon); + if (err == OK && !icon->is_empty()) { _make_icon(p_preset, icon, data); } } |