summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinkyu Kang <mk7.kang@samsung.com>2015-12-17 08:45:09 (GMT)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2015-12-17 08:45:09 (GMT)
commite2869dedc9d87dc1e9dbe208a8b96a0466e27007 (patch)
treee5390ccd9314c377c510140da612765f8ef1cccb
parent96d3912f199a4217f51f18a8b34b8be4e7886496 (diff)
parentfc311ca6d84a99fb53925488b9e5505e606de70d (diff)
downloadair_mediahub-e2869dedc9d87dc1e9dbe208a8b96a0466e27007.zip
air_mediahub-e2869dedc9d87dc1e9dbe208a8b96a0466e27007.tar.gz
air_mediahub-e2869dedc9d87dc1e9dbe208a8b96a0466e27007.tar.bz2
Merge "viewer: set image orient" into tizensubmit/tizen/20151218.013900accepted/tizen/tv/20151218.044156
-rw-r--r--include/util/util.h1
-rw-r--r--src/util/util.c25
-rw-r--r--src/view/viewer.c2
3 files changed, 28 insertions, 0 deletions
diff --git a/include/util/util.h b/include/util/util.h
index 3c29281..846e4fc 100644
--- a/include/util/util.h
+++ b/include/util/util.h
@@ -44,5 +44,6 @@ void util_add_to_recent(Eina_List *list, int index);
void util_create_thumbnail(Evas_Object *grid, app_media *am,
void (*completed_cb)(media_content_error_e,
const char *, void *));
+Elm_Image_Orient util_get_orient(media_content_orientation_e orient);
#endif /* __AIR_MEDIAHUB_UTIL_H__ */
diff --git a/src/util/util.c b/src/util/util.c
index 4a4f833..38e8e75 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -424,3 +424,28 @@ void util_create_thumbnail(Evas_Object *grid, app_media *am,
if (r != MEDIA_CONTENT_ERROR_NONE)
_ERR("failed to create thumbnail");
}
+
+Elm_Image_Orient util_get_orient(media_content_orientation_e orient)
+{
+ Elm_Image_Orient o;
+
+ switch (orient) {
+ case MEDIA_CONTENT_ORIENTATION_NORMAL:
+ o = ELM_IMAGE_ORIENT_0;
+ break;
+ case MEDIA_CONTENT_ORIENTATION_ROT_90:
+ o = ELM_IMAGE_ROTATE_90;
+ break;
+ case MEDIA_CONTENT_ORIENTATION_ROT_180:
+ o = ELM_IMAGE_ROTATE_180;
+ break;
+ case MEDIA_CONTENT_ORIENTATION_ROT_270:
+ o = ELM_IMAGE_ROTATE_270;
+ break;
+ default:
+ o = ELM_IMAGE_ORIENT_NONE;
+ break;
+ }
+
+ return o;
+}
diff --git a/src/view/viewer.c b/src/view/viewer.c
index 2605716..925db14 100644
--- a/src/view/viewer.c
+++ b/src/view/viewer.c
@@ -339,6 +339,8 @@ static void _draw_contents(struct _priv *priv, int id, app_media_info *mi)
elm_photocam_file_set(obj, mi->file_path);
elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT);
+ elm_photocam_image_orient_set(obj,
+ util_get_orient(mi->image->orientation));
}
static void _draw_title_bar(struct _priv *priv, int id, app_media_info *mi)