Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2022-09-13 03:27:02 +0300
committerHarley Acheson <harley.acheson@gmail.com>2022-09-13 03:28:19 +0300
commit28c9b338708027f71fe56834e87048309313b4d3 (patch)
treeb75f6cae4cd036a60bbe5c070a0a84db6657c6f1
parentc8b6062d6c0840ce5464dafef0c2bec5e532709f (diff)
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.
-rw-r--r--source/blender/imbuf/intern/webp.c8
1 files changed, 7 insertions, 1 deletions
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);