From b0aa49accbd7e45dae38f1bd43b0fbdd11714211 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 3 Sep 2015 23:24:55 -0300 Subject: merged some stuff for okam --- core/io/image_loader.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'core/io/image_loader.cpp') diff --git a/core/io/image_loader.cpp b/core/io/image_loader.cpp index d3390ae199..2db6e00f0a 100644 --- a/core/io/image_loader.cpp +++ b/core/io/image_loader.cpp @@ -50,8 +50,10 @@ Error ImageLoader::load_image(String p_file,Image *p_image, FileAccess *p_custom if (!f) { Error err; f=FileAccess::open(p_file,FileAccess::READ,&err); - if (!f) + if (!f) { + print_line("ERROR OPENING FILE: "+p_file); return err; + } } String extension = p_file.extension(); @@ -62,15 +64,20 @@ Error ImageLoader::load_image(String p_file,Image *p_image, FileAccess *p_custom if (!loader[i]->recognize(extension)) continue; Error err = loader[i]->load_image(p_image,f); + if (err!=ERR_FILE_UNRECOGNIZED) { + + if (!p_custom) memdelete(f); + return err; } } - + print_line("NO LOADER?"); + if (!p_custom) memdelete(f); -- cgit v1.2.3