From 14167128d1064d0d82dfca9d6097ff2237874cf5 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 18 Jul 2019 11:22:27 +0200 Subject: [PATCH] Disable image loader code. --- src/vector/config.h | 5 ++++- src/vector/vimageloader.cpp | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/vector/config.h b/src/vector/config.h index 712b3970cc..528115bcf1 100644 --- a/src/vector/config.h +++ b/src/vector/config.h @@ -8,9 +8,12 @@ //#define LOTTIE_LOGGING_SUPPORT //enable module building of image loader -#define LOTTIE_IMAGE_MODULE_SUPPORT +//#define LOTTIE_IMAGE_MODULE_SUPPORT //enable lottie model caching //#define LOTTIE_CACHE_SUPPORT +// disable image loader +#define LOTTIE_IMAGE_MODULE_DISABLED + #endif // CONFIG_H diff --git a/src/vector/vimageloader.cpp b/src/vector/vimageloader.cpp index 03c269a6fa..b4fd1884ef 100644 --- a/src/vector/vimageloader.cpp +++ b/src/vector/vimageloader.cpp @@ -19,6 +19,24 @@ using lottie_image_free_f = void (*)(unsigned char *); extern "C" { #endif +#ifdef LOTTIE_IMAGE_MODULE_DISABLED + +unsigned char *lottie_image_load(char const *filename, int *x, int *y, + int *comp, int req_comp) +{ + return nullptr; +} +unsigned char *lottie_image_load_from_data(const char *imageData, int len, + int *x, int *y, int *comp, + int req_comp) +{ + return nullptr; +} + +void lottie_image_free(unsigned char *data) {} + +#else + extern unsigned char *lottie_image_load(char const *filename, int *x, int *y, int *comp, int req_comp); extern unsigned char *lottie_image_load_from_data(const char *imageData, @@ -26,6 +44,8 @@ extern unsigned char *lottie_image_load_from_data(const char *imageData, int *comp, int req_comp); extern void lottie_image_free(unsigned char *data); +#endif + #ifdef __cplusplus } #endif