{
int err = MS_MEDIA_ERR_NONE;
mm_util_image_h decode_image = NULL;
+ mm_util_image_h rgba_thumbnail = NULL;
err = mm_util_decode_from_gif_file(path, &decode_image);
thumb_retvm_if(err != MM_UTIL_ERROR_NONE, MS_MEDIA_ERR_INTERNAL, "mm_util_decode_from_gif_file failed : %d", err);
- err = mm_util_resize_B_B(decode_image, thumb_w, thumb_h, thumbnail);
+ err = mm_util_resize_B_B(decode_image, thumb_w, thumb_h, &rgba_thumbnail);
mm_image_destroy_image(decode_image);
thumb_retvm_if(err != MM_UTIL_ERROR_NONE, MS_MEDIA_ERR_INTERNAL, "mm_util_resize_B_B failed : %d", err);
+ err = mm_util_convert_B_B(rgba_thumbnail, MM_UTIL_COLOR_BGRA, thumbnail);
+ mm_image_destroy_image(rgba_thumbnail);
+ thumb_retvm_if(err != MM_UTIL_ERROR_NONE, MS_MEDIA_ERR_INTERNAL, "mm_util_convert_B_B failed : %d", err);
+
return MS_MEDIA_ERR_NONE;
}
thumb_info("downscale: %d", downscale);
- return mm_util_decode_from_jpeg_file(path, MM_UTIL_COLOR_RGB24, downscale, decode_image);
+ return mm_util_decode_from_jpeg_file(path, MM_UTIL_COLOR_BGRA, downscale, decode_image);
}
static int __create_jpeg_thumbnail_to_file(const char *path, size_t image_size, unsigned int thumb_w, unsigned int thumb_h, const char *thumb_path, bool auto_rotate)