From 65f066d802ddf11e3d0aadb7d087b41cbca0a74a Mon Sep 17 00:00:00 2001 From: "min.ah.kim" Date: Wed, 10 Apr 2013 14:40:51 +0900 Subject: [PATCH] [content] modify parsing EXIF metadata Change-Id: Iff9df6748829c6ce322f32190b6d354c2eb854ef Signed-off-by: min.ah.kim --- src/FCnt_ContentManagerUtilImpl.cpp | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) mode change 100644 => 100755 src/FCnt_ContentManagerUtilImpl.cpp diff --git a/src/FCnt_ContentManagerUtilImpl.cpp b/src/FCnt_ContentManagerUtilImpl.cpp old mode 100644 new mode 100755 index 942720b..2881d29 --- a/src/FCnt_ContentManagerUtilImpl.cpp +++ b/src/FCnt_ContentManagerUtilImpl.cpp @@ -194,9 +194,35 @@ _ContentManagerUtilImpl::GetImageMetaN(const String& contentPath, bool internal) { ssBuff[l] = mmBuff[l + index + 1]; //add 1 to skip the ',' } + + char *pLocal; + std::unique_ptr pCurrentLocal(null); + pLocal = setlocale (LC_ALL, 0); // Get the name of the current locale. + if( pLocal == null ) + { + SysLog(NID_CNT, "setlocale failed. (get current locale)"); + continue; + } + pCurrentLocal.reset(strdup (pLocal)); + + pLocal = setlocale(LC_ALL, "C"); + if( pLocal == null ) + { + SysLog(NID_CNT, "setlocale failed. (set POSIX C locale)"); + continue; + } + double ddVal = atof(buf); // degree value double mmVal = atof(mmBuff); // minutesvalue double ssVal = atof(ssBuff); // seconds value + + pLocal = setlocale (LC_ALL, pCurrentLocal.get()); // restore the locale. + if( pLocal == null ) + { + SysLog(NID_CNT, "setlocale failed. (set current locale)"); + continue; + } + pMetadata->latitude = ddVal + (mmVal/MINUTES) + (ssVal/SECONDS); // if latitude designation is Southern (SOUTH) then latitude degree will be negative DD @@ -223,9 +249,35 @@ _ContentManagerUtilImpl::GetImageMetaN(const String& contentPath, bool internal) { ssBuff[l] = mmBuff[l + index + 1]; //add 1 to skip the ',' } + + char *pLocal; + std::unique_ptr pCurrentLocal(null); + pLocal = setlocale (LC_ALL, 0); // Get the name of the current locale. + if( pLocal == null ) + { + SysLog(NID_CNT, "setlocale failed. (get current locale)"); + continue; + } + pCurrentLocal.reset(strdup (pLocal)); + + pLocal = setlocale(LC_ALL, "C"); + if( pLocal == null ) + { + SysLog(NID_CNT, "setlocale failed. (set POSIX C locale)"); + continue; + } + double ddVal = atof(buf); // degree value double mmVal = atof(mmBuff); // minutesvalue double ssVal = atof(ssBuff); // seconds value + + pLocal = setlocale (LC_ALL, pCurrentLocal.get()); // restore the locale. + if( pLocal == null ) + { + SysLog(NID_CNT, "setlocale failed. (set current locale)"); + continue; + } + pMetadata->longitude = ddVal + (mmVal/MINUTES) + (ssVal/SECONDS); // if longitude designation is Western (WEST) then longitude degree will be negative DD -- 2.7.4