[content] Fix extracting orientation because of changing hardware
authorSeokpil Park <seokpil.park@samsung.com>
Tue, 13 Aug 2013 13:06:30 +0000 (22:06 +0900)
committerSeokpil Park <seokpil.park@samsung.com>
Tue, 13 Aug 2013 13:48:37 +0000 (22:48 +0900)
Change-Id: I5ce686834e737ef7b0cfc860a88b74ca20045f52
Signed-off-by: Seokpil Park <seokpil.park@samsung.com>
src/FCnt_ContentManagerUtilImpl.cpp

index 25754d4..10d08e4 100755 (executable)
@@ -123,6 +123,7 @@ _ContentManagerUtilImpl::GetImageMetaN(const String& contentPath, bool internal)
                        char latitudeRef = 0; // to store latitude reference (quadrasphere designation 'N', 'S', 'W' or 'E')
                        char longitudeRef = 0; // to store longitude reference (quadrasphere designation 'N', 'S', 'W' or 'E')
                        unsigned int entryCount = 0;
+                       bool isOrientation = false;
 
                        for (int i = 0; i < EXIF_IFD_COUNT; i++)
                        {
@@ -162,11 +163,13 @@ _ContentManagerUtilImpl::GetImageMetaN(const String& contentPath, bool internal)
                                                SysTryReturn(NID_CNT, pMetadata->pDateTime != null, null, E_OUT_OF_MEMORY,
                                                                "[E_OUT_OF_MEMORY] The memory is insufficient.");
                                        }
-                                       else if (tag == EXIF_TAG_ORIENTATION)
+                                       else if (tag == EXIF_TAG_ORIENTATION && !isOrientation)
                                        {
                                                //get the byte order(little endian or big endian) before extracting orientation type
                                                byteOrder = exif_data_get_byte_order(pEntries[j]->parent->parent);
                                                pMetadata->orientation = static_cast<ImageOrientationType>(exif_get_short(pEntries[j]->data, byteOrder));
+
+                                               isOrientation = true;
                                        }
                                        else if (tag == EXIF_TAG_SOFTWARE)
                                        {