Fix : The exception handling according to the situation
[platform/framework/native/content.git] / 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;