summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinkyu Kang <mk7.kang@samsung.com>2015-12-10 06:33:06 (GMT)
committerMinkyu Kang <mk7.kang@samsung.com>2015-12-10 06:33:06 (GMT)
commitfb1b7fe7db7457539d0949ee0eae5cdc646aaaed (patch)
tree524390027e885cc18b5ec746d7ab3673b662aa9e
parentc60e81353cedbb0ea44b662e3855b6f900e16c40 (diff)
downloadair_mediahub-fb1b7fe7db7457539d0949ee0eae5cdc646aaaed.zip
air_mediahub-fb1b7fe7db7457539d0949ee0eae5cdc646aaaed.tar.gz
air_mediahub-fb1b7fe7db7457539d0949ee0eae5cdc646aaaed.tar.bz2
viewer: modify _set_image_orientation routinerefs/changes/06/53906/1
Change-Id: I48238231d519f7f65e2cde14d825120be1cec593 Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
-rw-r--r--src/view/viewer.c40
1 files changed, 29 insertions, 11 deletions
diff --git a/src/view/viewer.c b/src/view/viewer.c
index 61cc384..4968fc4 100644
--- a/src/view/viewer.c
+++ b/src/view/viewer.c
@@ -471,7 +471,9 @@ static void _set_image_orientation(struct _priv *priv)
{
app_media *am;
app_media_info *mi;
- Evas_Object *image, *obj;
+ image_meta_h image;
+ media_content_orientation_e orient;
+ int r;
if (priv->viewer.cur != VIEWER_PHOTO)
return;
@@ -488,24 +490,40 @@ static void _set_image_orientation(struct _priv *priv)
return;
}
- image = elm_image_add(priv->base);
+ image = app_media_get_image_handle(am);
if (!image) {
- _ERR("failed to add image");
+ _ERR("failed to getting image handle");
return;
}
- elm_image_file_set(image, mi->file_path, NULL);
- elm_image_orient_set(image, ELM_IMAGE_ROTATE_270);
-
- obj = elm_image_object_get(image);
- if (!obj) {
- _ERR("failed to get image object");
+ switch (mi->image->orientation) {
+ case MEDIA_CONTENT_ORIENTATION_NORMAL:
+ orient = MEDIA_CONTENT_ORIENTATION_ROT_270;
+ break;
+ case MEDIA_CONTENT_ORIENTATION_ROT_90:
+ orient = MEDIA_CONTENT_ORIENTATION_NORMAL;
+ break;
+ case MEDIA_CONTENT_ORIENTATION_ROT_180:
+ orient = MEDIA_CONTENT_ORIENTATION_ROT_90;
+ break;
+ case MEDIA_CONTENT_ORIENTATION_ROT_270:
+ orient = MEDIA_CONTENT_ORIENTATION_ROT_180;
+ break;
+ default:
return;
}
- evas_object_image_save(obj, mi->file_path, NULL, "quality=100");
+ r = image_meta_set_orientation(image, orient);
+ if (r != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("failed to set played position");
+ return;
+ }
- media_info_refresh_metadata_to_db(mi->media_id);
+ r = image_meta_update_to_db(image);
+ if (r != MEDIA_CONTENT_ERROR_NONE) {
+ _ERR("failed to update db");
+ return;
+ }
app_media_update(am);
}