From 28c9b338708027f71fe56834e87048309313b4d3 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Mon, 12 Sep 2022 17:27:02 -0700 Subject: 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. --- source/blender/imbuf/intern/webp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender') 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 +#else +# include #endif #include @@ -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); -- cgit v1.2.3