#include <unistd.h>
#include <mm_file.h>
-#include <mm_util_imgp.h>
#include <mm_util_jpeg.h>
+#include <image_util.h>
#include <Evas.h>
#include <Ecore_Evas.h>
#include <libexif/exif-data.h>
#define MEDIA_THUMB_ROUND_UP_8(num) (((num)+7)&~7)
-static int __media_thumb_get_buffer_size(mm_util_img_format format, unsigned int width, unsigned int height, unsigned int *imgsize)
+static int __media_thumb_get_buffer_size(image_util_colorspace_e format, unsigned int width, unsigned int height, unsigned int *imgsize)
{
- if (mm_util_get_image_size(format, width, height, imgsize) < 0) {
- thumb_err("mm_util_get_image_size failed");
+ int err = IMAGE_UTIL_ERROR_NONE;
+
+ err = image_util_calculate_buffer_size(width, height, format, imgsize);
+ if (err != IMAGE_UTIL_ERROR_NONE) {
+ thumb_err("image_util_calculate_buffer_size failed");
return MS_MEDIA_ERR_INTERNAL;
}
int err = MS_MEDIA_ERR_NONE;
int i = 0, j;
- if (__media_thumb_get_buffer_size(MM_UTIL_IMG_FMT_BGRA8888, width, height, buf_size) < 0) {
+ if (__media_thumb_get_buffer_size(IMAGE_UTIL_COLORSPACE_BGRA8888, width, height, buf_size) < 0) {
thumb_err("__media_thumb_get_buffer_size failed");
return MS_MEDIA_ERR_INTERNAL;
}
evas_object_image_data_update_add(ret_image, 0, 0, thumb_width, thumb_height);
unsigned int buf_size = 0;
- if (__media_thumb_get_buffer_size(MM_UTIL_IMG_FMT_BGRA8888, thumb_width, thumb_height, &buf_size) < 0) {
+ if (__media_thumb_get_buffer_size(IMAGE_UTIL_COLORSPACE_BGRA8888, thumb_width, thumb_height, &buf_size) < 0) {
thumb_err("__media_thumb_get_buffer_size failed");
ecore_evas_free(resize_img_ee);
int err = MS_MEDIA_ERR_NONE;
int i = 0, count = 0;
- if (orientation == MM_UTIL_ROTATE_90) {
+ if (orientation == IMAGE_UTIL_ROTATION_90) {
count = 1;
- } else if (orientation == MM_UTIL_ROTATE_180) {
+ } else if (orientation == IMAGE_UTIL_ROTATION_180) {
count = 2;
- } else if (orientation == MM_UTIL_ROTATE_270) {
+ } else if (orientation == IMAGE_UTIL_ROTATION_270) {
count = 3;
}
thumb_width = decoded.width;
thumb_height = decoded.height;
- int rot_type = MM_UTIL_ROTATE_0;
+ int rot_type = IMAGE_UTIL_ROTATION_NONE;
if (orientation == ROT_90) {
- rot_type = MM_UTIL_ROTATE_90;
+ rot_type = IMAGE_UTIL_ROTATION_90;
} else if (orientation == ROT_180) {
- rot_type = MM_UTIL_ROTATE_180;
+ rot_type = IMAGE_UTIL_ROTATION_180;
} else if (orientation == ROT_270) {
- rot_type = MM_UTIL_ROTATE_270;
+ rot_type = IMAGE_UTIL_ROTATION_270;
}
err = _media_thumb_rotate_thumb(decoded.data, decoded.size, &(decoded.width), &(decoded.height), rot_type, MM_UTIL_JPEG_FMT_RGB888);
if (err != MS_MEDIA_ERR_NONE) {
evas_object_image_data_update_add(ret_image, 0, 0, thumb_width, thumb_height);
unsigned int buf_size = 0;
- if (__media_thumb_get_buffer_size(MM_UTIL_IMG_FMT_BGRA8888, thumb_width, thumb_height, &buf_size) < 0) {
+ if (__media_thumb_get_buffer_size(IMAGE_UTIL_COLORSPACE_BGRA8888, thumb_width, thumb_height, &buf_size) < 0) {
thumb_err("__media_thumb_get_buffer_size failed");
ecore_evas_free(resize_img_ee);
unsigned char *dst_data = NULL;
int i = 0, j;
- if (__media_thumb_get_buffer_size(MM_UTIL_IMG_FMT_BGRA8888, thumb_width, thumb_height, &buf_size) < 0) {
+ if (__media_thumb_get_buffer_size(IMAGE_UTIL_COLORSPACE_BGRA8888, thumb_width, thumb_height, &buf_size) < 0) {
thumb_err("__media_thumb_get_buffer_size failed");
return MS_MEDIA_ERR_INTERNAL;
}
return MS_MEDIA_ERR_INTERNAL;
}
- err = __media_thumb_get_buffer_size(MM_UTIL_IMG_FMT_RGB888, thumb_info->origin_width, thumb_info->origin_height, &thumb_size);
+ err = __media_thumb_get_buffer_size(IMAGE_UTIL_COLORSPACE_RGB888, thumb_info->origin_width, thumb_info->origin_height, &thumb_size);
if (err != MS_MEDIA_ERR_NONE) {
thumb_err("__media_thumb_get_buffer_size failed: %d", err);
SAFE_FREE(thumb);
char *p = NULL;
int cdis_value = 0;
err = mm_file_create_tag_attrs(&tag, origin_path);
- mm_util_img_rotate_type rot_type = MM_UTIL_ROTATE_0;
+ image_util_rotation_e rot_type = IMAGE_UTIL_ROTATION_NONE;
if (err == FILEINFO_ERROR_NONE) {
err = mm_file_get_attrs(tag, &err_msg, MM_FILE_TAG_ROTATE, &p, &size, NULL);
if (err == FILEINFO_ERROR_NONE && size >= 0) {
if (p == NULL) {
- rot_type = MM_UTIL_ROTATE_0;
+ rot_type = IMAGE_UTIL_ROTATION_NONE;
} else {
if (strncmp(p, "90", size) == 0) {
- rot_type = MM_UTIL_ROTATE_90;
+ rot_type = IMAGE_UTIL_ROTATION_90;
} else if (strncmp(p, "180", size) == 0) {
- rot_type = MM_UTIL_ROTATE_180;
+ rot_type = IMAGE_UTIL_ROTATION_180;
} else if (strncmp(p, "270", size) == 0) {
- rot_type = MM_UTIL_ROTATE_270;
+ rot_type = IMAGE_UTIL_ROTATION_270;
} else {
- rot_type = MM_UTIL_ROTATE_0;
+ rot_type = IMAGE_UTIL_ROTATION_NONE;
}
}
thumb_dbg("There is tag rotate : %d", rot_type);
} else {
thumb_dbg("There is NOT tag rotate");
- rot_type = MM_UTIL_ROTATE_0;
+ rot_type = IMAGE_UTIL_ROTATION_NONE;
SAFE_FREE(err_msg);
}
}
} else {
- rot_type = MM_UTIL_ROTATE_0;
+ rot_type = IMAGE_UTIL_ROTATION_NONE;
cdis_value = 0;
}
}
SAFE_FREE(new_frame);
- if (rot_type == MM_UTIL_ROTATE_90 || rot_type == MM_UTIL_ROTATE_180 || rot_type == MM_UTIL_ROTATE_270) {
+ if (rot_type == IMAGE_UTIL_ROTATION_90 || rot_type == IMAGE_UTIL_ROTATION_180 || rot_type == IMAGE_UTIL_ROTATION_270) {
err = _media_thumb_rotate_thumb(thumb_info->data, thumb_info->size, &(thumb_info->width), &(thumb_info->height), rot_type, MM_UTIL_JPEG_FMT_BGRA8888);
if (err != MS_MEDIA_ERR_NONE) {
thumb_err("_media_thumb_rotate_thumb falied: %d", err);