[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
|
|
@ -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];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue