#include <mm_file.h>
#include <mm_util_image.h>
#include <mm_util_magick.h>
-#if defined(USE_MEMORY_USAGE_REDUCTION)
#include <mm_util_gif.h>
#include <mm_util_jpeg.h>
#include <libexif/exif-data.h>
-#endif
#include "media-thumbnail.h"
#include "media-thumbnail-debug.h"
return THUMB_OK;
}
-#if defined(USE_MEMORY_USAGE_REDUCTION)
static mm_util_rotate_type_e __get_image_orientation(const char *path)
{
ExifData *ed = NULL;
return THUMB_OK;
}
-#endif
int create_image_thumbnail_to_file(const char *path, unsigned int width, unsigned int height, const char *thumb_path, bool auto_rotate)
{
err = __adjust_thumb_ratio(path, &thumb_w, &thumb_h, &image_w, &image_h, &image_type);
thumb_retvm_if(err != THUMB_OK, err, "__adjust_thumb_ratio failed");
-#if defined(USE_MEMORY_USAGE_REDUCTION)
if (image_type == IMG_CODEC_GIF)
return __create_gif_thumbnail_to_file(path, thumb_w, thumb_h, thumb_path);
else if (image_type == IMG_CODEC_JPEG)
return __create_jpeg_thumbnail_to_file(path, (size_t)(image_w * image_h), thumb_w, thumb_h, thumb_path, auto_rotate);
-#endif
if (auto_rotate)
err = mm_util_resize_and_rotate_P_P(path, thumb_w, thumb_h, thumb_path);
err = __adjust_thumb_ratio(path, &thumb_w, &thumb_h, &image_w, &image_h, &image_type);
thumb_retvm_if(err != THUMB_OK, err, "__adjust_thumb_ratio failed");
-#if defined(USE_MEMORY_USAGE_REDUCTION)
if (image_type == IMG_CODEC_GIF) {
err = __create_gif_thumbnail_to_buffer(path, thumb_w, thumb_h, &img);
thumb_retvm_if(err != MM_UTIL_ERROR_NONE, THUMB_FAIL, "__create_gif_thumbnail_to_buffer failed : %d", err);
} else if (image_type == IMG_CODEC_JPEG) {
err = __create_jpeg_thumbnail_to_buffer(path, (size_t)(image_w * image_h), thumb_w, thumb_h, &img);
thumb_retvm_if(err != MM_UTIL_ERROR_NONE, THUMB_FAIL, "__create_jpeg_thumbnail_to_buffer failed : %d", err);
- } else
-#endif
- {
+ } else {
err = mm_util_resize_P_B(path, thumb_w, thumb_h, MM_UTIL_COLOR_BGRA, &img);
thumb_retvm_if(err != MM_UTIL_ERROR_NONE, THUMB_FAIL, "mm_util_resize_P_B failed : %d", err);
}