summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Nazarov <i.nazarov@samsung.com>2017-06-01 10:15:46 +0300
committerIgor Nazarov <i.nazarov@samsung.com>2017-06-01 10:15:46 +0300
commit301f33773cf2296372fbcc7848f243f59cfe27fc (patch)
tree1046ee92b0c721ac06fdaa3f52fb0c3a1ae8f47c
parentae7e683b417b15b8b3e113eb5ed333dc61e3404c (diff)
downloadgallery-301f33773cf2296372fbcc7848f243f59cfe27fc.tar.gz
gallery-301f33773cf2296372fbcc7848f243f59cfe27fc.tar.bz2
gallery-301f33773cf2296372fbcc7848f243f59cfe27fc.zip
TizenRefApp-8612 [Gallery] Respect EXIF rotation flag
Change-Id: Iec65a61da3cb6a51ad223126bba03231d6ee7288
-rw-r--r--src/model/MediaItem.cpp16
-rw-r--r--src/view/ImageGrid.cpp3
-rw-r--r--src/view/ImageViewer.cpp2
3 files changed, 21 insertions, 0 deletions
diff --git a/src/model/MediaItem.cpp b/src/model/MediaItem.cpp
index 61d3a27..db7b222 100644
--- a/src/model/MediaItem.cpp
+++ b/src/model/MediaItem.cpp
@@ -256,6 +256,22 @@ namespace gallery {
FAIL_RETURN(util::getNz(image_meta_get_height, m_resolutionY,
imageMeta), "image_meta_get_height() failed!");
+ media_content_orientation_e orientation =
+ MEDIA_CONTENT_ORIENTATION_NOT_AVAILABLE;
+ FAIL_RETURN(util::get(image_meta_get_orientation, orientation,
+ imageMeta), "image_meta_get_orientation() failed!");
+
+ switch (orientation) {
+ case MEDIA_CONTENT_ORIENTATION_TRANSPOSE:
+ case MEDIA_CONTENT_ORIENTATION_ROT_90:
+ case MEDIA_CONTENT_ORIENTATION_TRANSVERSE:
+ case MEDIA_CONTENT_ORIENTATION_ROT_270:
+ std::swap(m_resolutionX, m_resolutionY);
+ break;
+ default:
+ break;
+ }
+
return RES_OK;
}
diff --git a/src/view/ImageGrid.cpp b/src/view/ImageGrid.cpp
index ae974d6..29cabf9 100644
--- a/src/view/ImageGrid.cpp
+++ b/src/view/ImageGrid.cpp
@@ -249,6 +249,7 @@ namespace gallery {
m_btn.setStyle(imageGrid.m_info.btnStyle);
show(m_btn);
+ evas_object_image_load_orientation_set(m_image, EINA_TRUE);
m_btn.setContent(m_image);
show(m_image);
@@ -479,6 +480,8 @@ namespace gallery {
if (!m_bgImage) {
m_bgImage = makeShared<Widget>(
evas_object_image_filled_add(m_btn.getEvas()));
+ evas_object_image_load_orientation_set(*m_bgImage,
+ EINA_TRUE);
m_btn.setContent(*m_bgImage, impl::BTN_PART_BG);
show(*m_bgImage);
}
diff --git a/src/view/ImageViewer.cpp b/src/view/ImageViewer.cpp
index 0437bfc..6d5e0d6 100644
--- a/src/view/ImageViewer.cpp
+++ b/src/view/ImageViewer.cpp
@@ -139,6 +139,7 @@ namespace gallery {
m_layout.setContent(m_grid);
show(m_grid);
+ evas_object_image_load_orientation_set(m_lowResImage, EINA_TRUE);
evas_object_grid_pack(m_grid, m_lowResImage, 0, 0, 1, 1);
if (loadSize > 0) {
evas_object_image_load_size_set(m_lowResImage, loadSize, loadSize);
@@ -146,6 +147,7 @@ namespace gallery {
show(m_lowResImage);
makeTransparent(m_lowResImage);
+ evas_object_image_load_orientation_set(m_highResImage, EINA_TRUE);
evas_object_grid_pack(m_grid, m_highResImage, 0, 0, 1, 1);
if (forceLoad) {
if (loadSize > 0) {