[Export] Use image loader directly to avoid "resource as image file" errors.
This commit is contained in:
parent
dce1602eda
commit
908bef8eee
3 changed files with 13 additions and 7 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue