thumb_width = decoded.width;
thumb_height = decoded.height;
- if (is_rotated) {
#if THUMB_PERFORMANCE_ENHANCED
- int rot_type = MM_UTIL_ROTATE_0;
- if (orientation == ROT_90) {
- rot_type = MM_UTIL_ROTATE_90;
- } else if (orientation == ROT_180) {
- rot_type = MM_UTIL_ROTATE_180;
- } else if (orientation == ROT_270) {
- rot_type = MM_UTIL_ROTATE_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) {
- thumb_err("_media_thumb_rotate_thumb falied: %d", err);
- SAFE_FREE(thumb_info->data);
- return err;
- }
- //thumb_dbg("Width : %d, Height : %d", decoded.width, decoded.height);
- thumb_info->data = decoded.data;
- thumb_info->size = decoded.size;
- thumb_info->width = decoded.width;
- thumb_info->height = decoded.height;
+ int rot_type = MM_UTIL_ROTATE_0;
+ if (orientation == ROT_90) {
+ rot_type = MM_UTIL_ROTATE_90;
+ } else if (orientation == ROT_180) {
+ rot_type = MM_UTIL_ROTATE_180;
+ } else if (orientation == ROT_270) {
+ rot_type = MM_UTIL_ROTATE_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) {
+ thumb_err("_media_thumb_rotate_thumb falied: %d", err);
+ SAFE_FREE(thumb_info->data);
+ return err;
+ }
+ //thumb_dbg("Width : %d, Height : %d", decoded.width, decoded.height);
+ thumb_info->data = decoded.data;
+ thumb_info->size = decoded.size;
+ thumb_info->width = decoded.width;
+ thumb_info->height = decoded.height;
#else
- /* Start to decode to rotate */
- unsigned char *rotated = NULL;
- unsigned int r_w = decoded.height;
- unsigned int r_h = decoded.width;
- unsigned int r_size = 0;
- mm_util_img_rotate_type rot_type = MM_UTIL_ROTATE_0;
-
- int i, rotate_cnt = 0;
+ /* Start to decode to rotate */
+ unsigned char *rotated = NULL;
+ unsigned int r_w = decoded.height;
+ unsigned int r_h = decoded.width;
+ unsigned int r_size = 0;
+ mm_util_img_rotate_type rot_type = MM_UTIL_ROTATE_0;
+
+ int i, rotate_cnt = 0;
+
+ rot_type = MM_UTIL_ROTATE_90;
+ if (orientation == ROT_90) {
+ rotate_cnt = 1;
+ } else if (orientation == ROT_180) {
+ rotate_cnt = 2;
+ } else if (orientation == ROT_270) {
+ rotate_cnt = 3;
+ }
- rot_type = MM_UTIL_ROTATE_90;
- if (orientation == ROT_90) {
- rotate_cnt = 1;
- } else if (orientation == ROT_180) {
- rotate_cnt = 2;
- } else if (orientation == ROT_270) {
- rotate_cnt = 3;
+ for (i = 0; i < rotate_cnt; i++) {
+ if (i == 1) {
+ r_w = decoded.width;
+ r_h = decoded.height;
}
- for (i = 0; i < rotate_cnt; i++) {
- if (i == 1) {
- r_w = decoded.width;
- r_h = decoded.height;
- }
-
- err = mm_util_get_image_size(MM_UTIL_IMG_FMT_RGB888, r_w, r_h, &r_size);
- if (err != MS_MEDIA_ERR_NONE) {
- thumb_err("mm_util_get_image_size failed : %d", err);
- SAFE_FREE(decoded.data);
- return err;
- }
-
- rotated = (unsigned char *)malloc(r_size);
- err = mm_util_rotate_image(decoded.data, decoded.width, decoded.height,
- MM_UTIL_IMG_FMT_RGB888,
- rotated, &r_w, &r_h,
- rot_type);
+ err = mm_util_get_image_size(MM_UTIL_IMG_FMT_RGB888, r_w, r_h, &r_size);
+ if (err != MS_MEDIA_ERR_NONE) {
+ thumb_err("mm_util_get_image_size failed : %d", err);
+ SAFE_FREE(decoded.data);
+ return err;
+ }
- if (err != MS_MEDIA_ERR_NONE) {
- thumb_err("mm_util_rotate_image failed : %d", err);
- SAFE_FREE(decoded.data);
- SAFE_FREE(rotated);
- return err;
- } else {
- thumb_err("mm_util_rotate_image succeed");
- }
+ rotated = (unsigned char *)malloc(r_size);
+ err = mm_util_rotate_image(decoded.data, decoded.width, decoded.height,
+ MM_UTIL_IMG_FMT_RGB888,
+ rotated, &r_w, &r_h,
+ rot_type);
+ if (err != MS_MEDIA_ERR_NONE) {
+ thumb_err("mm_util_rotate_image failed : %d", err);
SAFE_FREE(decoded.data);
- decoded.data = rotated;
- decoded.width = r_w;
- decoded.height = r_h;
+ SAFE_FREE(rotated);
+ return err;
+ } else {
+ thumb_err("mm_util_rotate_image succeed");
}
- //thumb_dbg("Width : %d, Height : %d", r_w, r_h);
- thumb_info->data = rotated;
- thumb_info->size = r_size;
- thumb_info->width = r_w;
- thumb_info->height = r_h;
-#endif
- } else {
- thumb_warn("Unknown orientation");
SAFE_FREE(decoded.data);
- return MS_MEDIA_ERR_INVALID_PARAMETER;
+ decoded.data = rotated;
+ decoded.width = r_w;
+ decoded.height = r_h;
}
+
+ //thumb_dbg("Width : %d, Height : %d", r_w, r_h);
+ thumb_info->data = rotated;
+ thumb_info->size = r_size;
+ thumb_info->width = r_w;
+ thumb_info->height = r_h;
+#endif
} else {
/*in this case, just write raw data in file */
thumb_dbg_slog("Thumb is :%s", thumb_path);