From c5efe5d625529af5df908808791599f8dceaf50c Mon Sep 17 00:00:00 2001 From: geequlim Date: Sun, 15 Jul 2018 01:42:37 +0800 Subject: Add webp buffer loader for Image Cleanup the code memory load related code for Image Fix jpeg buff load function always returns OK event failed --- modules/jpg/image_loader_jpegd.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'modules/jpg') diff --git a/modules/jpg/image_loader_jpegd.cpp b/modules/jpg/image_loader_jpegd.cpp index 0168be3a26..437c0d57fa 100644 --- a/modules/jpg/image_loader_jpegd.cpp +++ b/modules/jpg/image_loader_jpegd.cpp @@ -121,9 +121,7 @@ static Ref _jpegd_mem_loader_func(const uint8_t *p_png, int p_size) { Ref img; img.instance(); Error err = jpeg_load_image_from_buffer(img.ptr(), p_png, p_size); - if (err) - ERR_PRINT("Couldn't initialize ImageLoaderJPG with the given resource."); - + ERR_FAIL_COND_V(err, Ref()); return img; } -- cgit v1.2.3