From: Minje Ahn Date: Fri, 18 Sep 2015 05:08:03 +0000 (+0900) Subject: Bug fix of getting location information in Exif X-Git-Tag: accepted/tizen/mobile/20150920.232502^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bde4a5a1866317c2e3e23c256415aeda2829a354;p=platform%2Fcore%2Fmultimedia%2Flibmedia-service.git Bug fix of getting location information in Exif Change-Id: Ibbac42b90083b7ee1ebec0db5cb74c6d1a7f33b9 Signed-off-by: Minje Ahn --- diff --git a/src/common/media-svc-util.c b/src/common/media-svc-util.c index 64822ca..08459e7 100755 --- a/src/common/media-svc-util.c +++ b/src/common/media-svc-util.c @@ -1109,18 +1109,14 @@ int _media_svc_extract_image_metadata(sqlite3 *handle, media_svc_content_info_s goto GET_WIDTH_HEIGHT; } - if (__media_svc_get_exif_info(ed, buf, NULL, NULL, EXIF_IFD_0, EXIF_TAG_GPS_LATITUDE_REF) == MS_MEDIA_ERR_NONE) { - if (strlen(buf) != 0) { - if (__media_svc_get_exif_info(ed, NULL, NULL, &value, EXIF_IFD_GPS, EXIF_TAG_GPS_LATITUDE) == MS_MEDIA_ERR_NONE) { - + if (__media_svc_get_exif_info(ed, NULL, NULL, &value, EXIF_IFD_GPS, EXIF_TAG_GPS_LATITUDE) == MS_MEDIA_ERR_NONE) { + if (__media_svc_get_exif_info(ed, buf, NULL, NULL, EXIF_IFD_GPS, EXIF_TAG_GPS_LATITUDE_REF) == MS_MEDIA_ERR_NONE) { + if (strlen(buf) > 0) { if (strcmp(buf, "S") == 0) { value = -1 * value; } - - content_info->media_meta.latitude = value; - } else { - content_info->media_meta.latitude = MEDIA_SVC_DEFAULT_GPS_VALUE; } + content_info->media_meta.latitude = value; } else { content_info->media_meta.latitude = MEDIA_SVC_DEFAULT_GPS_VALUE; } @@ -1130,16 +1126,14 @@ int _media_svc_extract_image_metadata(sqlite3 *handle, media_svc_content_info_s memset(buf, 0x00, sizeof(buf)); - if (__media_svc_get_exif_info(ed, buf, NULL, NULL, EXIF_IFD_0, EXIF_TAG_GPS_LONGITUDE_REF) == MS_MEDIA_ERR_NONE) { - if (strlen(buf) != 0) { - if (__media_svc_get_exif_info(ed, NULL, NULL, &value, EXIF_IFD_GPS, EXIF_TAG_GPS_LONGITUDE) == MS_MEDIA_ERR_NONE) { + if (__media_svc_get_exif_info(ed, NULL, NULL, &value, EXIF_IFD_GPS, EXIF_TAG_GPS_LONGITUDE) == MS_MEDIA_ERR_NONE) { + if (__media_svc_get_exif_info(ed, buf, NULL, NULL, EXIF_IFD_GPS, EXIF_TAG_GPS_LONGITUDE_REF) == MS_MEDIA_ERR_NONE) { + if (strlen(buf) > 0) { if (strcmp(buf, "W") == 0) { value = -1 * value; } - content_info->media_meta.longitude = value; - } else { - content_info->media_meta.longitude = MEDIA_SVC_DEFAULT_GPS_VALUE; } + content_info->media_meta.longitude = value; } else { content_info->media_meta.longitude = MEDIA_SVC_DEFAULT_GPS_VALUE; }