From bde4a5a1866317c2e3e23c256415aeda2829a354 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Fri, 18 Sep 2015 14:08:03 +0900 Subject: [PATCH] Bug fix of getting location information in Exif Change-Id: Ibbac42b90083b7ee1ebec0db5cb74c6d1a7f33b9 Signed-off-by: Minje Ahn --- src/common/media-svc-util.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) 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; } -- 2.7.4