int create_video_thumbnail_to_file(const char *path, unsigned int width, unsigned int height, const char *thumb_path, bool auto_rotate);
int create_video_thumbnail_to_buffer(const char *path, unsigned int width, unsigned int height, unsigned char **thumb_buffer, size_t *thumb_size, unsigned int *thumb_width, unsigned int *thumb_height, bool auto_rotate);
-int create_image_thumbnail_to_file(const char *path, unsigned int width, unsigned int height, const char *thumb_path);
+int create_image_thumbnail_to_file(const char *path, unsigned int width, unsigned int height, const char *thumb_path, bool auto_rotate);
int create_image_thumbnail_to_buffer(const char *path, unsigned int width, unsigned int height, unsigned char **thumb_buffer, size_t *thumb_size, unsigned int *thumb_width, unsigned int *thumb_height);
file_type = _media_thumb_get_file_type(origin_path);
if (file_type == THUMB_IMAGE_TYPE) {
- err = create_image_thumbnail_to_file(origin_path, CONTENT_THUMB_DEFAULT_WIDTH, CONTENT_THUMB_DEFAULT_HEIGHT, thumb_path);
+ err = create_image_thumbnail_to_file(origin_path, CONTENT_THUMB_DEFAULT_WIDTH, CONTENT_THUMB_DEFAULT_HEIGHT, thumb_path, true);
} else if (file_type == THUMB_VIDEO_TYPE) {
err = create_video_thumbnail_to_file(origin_path, CONTENT_THUMB_DEFAULT_WIDTH, CONTENT_THUMB_DEFAULT_HEIGHT, thumb_path, true);
} else {
return MS_MEDIA_ERR_NONE;
}
-int create_image_thumbnail_to_file(const char *path, unsigned int width, unsigned int height, const char *thumb_path)
+int create_image_thumbnail_to_file(const char *path, unsigned int width, unsigned int height, const char *thumb_path, bool auto_rotate)
{
int err = MS_MEDIA_ERR_NONE;
unsigned int image_w = 0;
//Extract thumbnail
__media_thumb_get_proper_thumb_size(image_w, image_h, &thumb_w, &thumb_h);
- err = mm_util_resize_P_P(path, thumb_w, thumb_h, thumb_path);
+ if (auto_rotate)
+ err = mm_util_resize_and_rotate_P_P(path, thumb_w, thumb_h, thumb_path);
+ else
+ err = mm_util_resize_P_P(path, thumb_w, thumb_h, thumb_path);
thumb_retvm_if(err != MM_UTIL_ERROR_NONE, MS_MEDIA_ERR_INTERNAL, "mm_util_resize_P_P failed : %d", err);
return MS_MEDIA_ERR_NONE;