Fix : Set default coordinates when coordinates are invalid 61/12661/3
authorSeokpil Park <seokpil.park@samsung.com>
Fri, 30 Aug 2013 09:23:42 +0000 (18:23 +0900)
committerJaehwa Shin <jaehwa.shin@samsung.com>
Thu, 21 Nov 2013 04:34:58 +0000 (20:34 -0800)
Change-Id: Iab525a6796f6b288e97a8f9627052ef32451d3cb
Signed-off-by: Seokpil Park <seokpil.park@samsung.com>
src/FCnt_ContentManagerUtilImpl.cpp

index 3393c15..0b82aa0 100755 (executable)
@@ -66,6 +66,7 @@ static const int _THUMBNAIL_IMAGE_WIDTH = 80;
 static const int _THUMBNAIL_IMAGE_HEIGHT = 60;
 static const int _MINUTES = 60;
 static const int _SECONDS = 3600;
+static const double DEFAULT_COORDINATE = -200.0;
 
 ImageMetadata*
 _ContentManagerUtilImpl::GetImageMetaN(const String& contentPath, bool internal)
@@ -191,6 +192,13 @@ _ContentManagerUtilImpl::GetImageMetaN(const String& contentPath, bool internal)
                                        else if (tag == EXIF_TAG_GPS_LATITUDE && !isLatitude)
                                        {
                                                String tempLatitude(buf);
+                                               if (!tempLatitude.Contains(L","))
+                                               {
+                                                       pMetadata->latitude = DEFAULT_COORDINATE;
+                                                       isLatitude = true;
+                                                       continue;
+                                               }
+
                                                int firstComma = 0;
                                                int lastComma = 0;
 
@@ -244,6 +252,13 @@ _ContentManagerUtilImpl::GetImageMetaN(const String& contentPath, bool internal)
                                        else if (tag == EXIF_TAG_GPS_LONGITUDE && !isLongitude)
                                        {
                                                String tempLongitude(buf);
+                                               if (!tempLongitude.Contains(L","))
+                                               {
+                                                       pMetadata->longitude = DEFAULT_COORDINATE;
+                                                       isLongitude = true;
+                                                       continue;
+                                               }
+
                                                int firstComma = 0;
                                                int lastComma = 0;
 
@@ -998,6 +1013,13 @@ _ContentManagerUtilImpl::GetImageMetaN(const ByteBuffer& byteBuffer)
                                        else if (tag == EXIF_TAG_GPS_LATITUDE && !isLatitude)
                                        {
                                                String tempLatitude(buf);
+                                               if (!tempLatitude.Contains(L","))
+                                               {
+                                                       pMetadata->latitude = DEFAULT_COORDINATE;
+                                                       isLatitude = true;
+                                                       continue;
+                                               }
+
                                                int firstComma = 0;
                                                int lastComma = 0;
 
@@ -1051,6 +1073,13 @@ _ContentManagerUtilImpl::GetImageMetaN(const ByteBuffer& byteBuffer)
                                        else if (tag == EXIF_TAG_GPS_LONGITUDE && !isLongitude)
                                        {
                                                String tempLongitude(buf);
+                                               if (!tempLongitude.Contains(L","))
+                                               {
+                                                       pMetadata->longitude = DEFAULT_COORDINATE;
+                                                       isLongitude = true;
+                                                       continue;
+                                               }
+
                                                int firstComma = 0;
                                                int lastComma = 0;