diff options
author | Minkyu Kang <mk7.kang@samsung.com> | 2015-12-17 17:06:52 +0900 |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2015-12-17 17:06:52 +0900 |
commit | fc311ca6d84a99fb53925488b9e5505e606de70d (patch) | |
tree | 052fc64ad9e59af281ac4fed4b006eea13f5abbe | |
parent | be296b1a2cce3a2458ac05a680e295c9ab32a77f (diff) | |
download | air_mediahub-fc311ca6d84a99fb53925488b9e5505e606de70d.tar.gz air_mediahub-fc311ca6d84a99fb53925488b9e5505e606de70d.tar.bz2 air_mediahub-fc311ca6d84a99fb53925488b9e5505e606de70d.zip |
viewer: set image orient
Change-Id: I715af4211818a7f7dd589fb9523ef17071b86bce
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
-rw-r--r-- | include/util/util.h | 1 | ||||
-rw-r--r-- | src/util/util.c | 25 | ||||
-rw-r--r-- | src/view/viewer.c | 2 |
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) |