diff options
author | geequlim <geequlim@gmail.com> | 2018-07-15 01:42:37 +0800 |
---|---|---|
committer | geequlim <geequlim@gmail.com> | 2018-07-17 12:03:45 +0800 |
commit | c5efe5d625529af5df908808791599f8dceaf50c (patch) | |
tree | 043f176d55331ecea69eba1a4520148bcefc98fe /modules/jpg | |
parent | 1fc7973a00e17025441b6b8333e38d1606c1d304 (diff) |
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
Diffstat (limited to 'modules/jpg')
-rw-r--r-- | modules/jpg/image_loader_jpegd.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
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<Image> _jpegd_mem_loader_func(const uint8_t *p_png, int p_size) { Ref<Image> 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<Image>()); return img; } |