[Bf-blender-cvs] [28c9b338708] master: IMBUF: Fix WebP Build Error and Warnings
Harley Acheson
noreply at git.blender.org
Tue Sep 13 02:28:27 CEST 2022
Commit: 28c9b338708027f71fe56834e87048309313b4d3
Author: Harley Acheson
Date: Mon Sep 12 17:27:02 2022 -0700
Branches: master
https://developer.blender.org/rB28c9b338708027f71fe56834e87048309313b4d3
IMBUF: Fix WebP Build Error and Warnings
Fix error and warnings introduced in commit 8851790dd733. Include
unistd.h for close() on Non-Windows OSs. Calm warnings about unused
argument. Return full size of image file to caller.
Own Code.
===================================================================
M source/blender/imbuf/intern/webp.c
===================================================================
diff --git a/source/blender/imbuf/intern/webp.c b/source/blender/imbuf/intern/webp.c
index 40be072177e..94c8e3fb61d 100644
--- a/source/blender/imbuf/intern/webp.c
+++ b/source/blender/imbuf/intern/webp.c
@@ -6,6 +6,8 @@
#ifdef _WIN32
# include <io.h>
+#else
+# include <unistd.h>
#endif
#include <fcntl.h>
@@ -75,7 +77,7 @@ ImBuf *imb_loadwebp(const unsigned char *mem,
}
struct ImBuf *imb_load_filepath_thumbnail_webp(const char *filepath,
- const int flags,
+ const int UNUSED(flags),
const size_t max_thumb_size,
char colorspace[],
size_t *r_width,
@@ -108,6 +110,10 @@ struct ImBuf *imb_load_filepath_thumbnail_webp(const char *filepath,
return NULL;
}
+ /* Return full size of the image. */
+ *r_width = (size_t)config.input.width;
+ *r_height = (size_t)config.input.height;
+
const float scale = (float)max_thumb_size / MAX2(config.input.width, config.input.height);
const int dest_w = (int)(config.input.width * scale);
const int dest_h = (int)(config.input.height * scale);
More information about the Bf-blender-cvs
mailing list