_ImageContentInfoImpl::_ImageContentInfoImpl(void)
: __width(0)
, __height(0)
+ , __isBurst(false)
, __orientationType(IMAGE_ORIENTATION_TYPE_UNKNOWN)
, __title(L"")
+ , __burstShotId(L"")
{
}
_ImageContentInfoImpl::Construct(const String& contentPath, const String& thumbnailPath, bool setGps)
{
result r = E_SUCCESS;
- int contentLength = 0;
- FileAttributes attribute;
+ String tempPath(contentPath);
+
+ if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
+ {
+ if (contentPath.StartsWith(OSP_MEDIA_PHONE, 0))
+ {
+ // Because the content path is saved like /opt/media or /opt/storage/sdcard/ in SLP database,
+ // it should be converted in 2.0.
+ r = tempPath.Replace(OSP_MEDIA_PHONE, Environment::GetMediaPath());
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Construct() failed.");
+ }
+ else if (contentPath.StartsWith(OSP_MEDIA_MMC, 0))
+ {
+ r = tempPath.Replace(OSP_MEDIA_MMC, Environment::GetExternalStoragePath());
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Construct() failed.");
+ }
+ else
+ {
+ SysLogException(NID_CNT, E_INVALID_ARG,
+ "[E_INVALID_ARG] The contentPath should start with /Media or /Storagecard/Media.");
+ return E_INVALID_ARG;
+ }
+ }
// checks parameters
- contentLength = contentPath.GetLength();
SysTryReturnResult(NID_CNT, _FileImpl::IsMediaPath(contentPath), E_INVALID_ARG,
"The contentPath should start with /Media or /Storagecard/Media.");
SysTryReturnResult(NID_CNT, File::IsFileExist(contentPath), E_FILE_NOT_FOUND,
SysLog(NID_CNT, "The setGps is not supported.");
}
- SetContentPath(contentPath);
+ SetContentPath(tempPath);
SetContentType(CONTENT_TYPE_IMAGE);
return r;
int length = contentPath.GetLength();
SysTryReturnResult(NID_CNT, length != 0, E_INVALID_ARG,
"The length of pContentPath is 0.");
- SysTryReturnResult(NID_CNT, File::IsFileExist(contentPath), E_FILE_NOT_FOUND,
+ SysTryReturnResult(NID_CNT, File::IsFileExist(*pContentPath), E_FILE_NOT_FOUND,
"The file corresponding to pContentPath could not be found.");
SetContentPath(contentPath);
return __orientationType;
}
+DateTime
+_ImageContentInfoImpl::GetImageTakenDate(void) const
+{
+ return __takenDate;
+}
+
String
_ImageContentInfoImpl::GetTitle(void) const
{
return __title;
}
+bool
+_ImageContentInfoImpl::IsBurstShot(void) const
+{
+ return __isBurst;
+}
+
+String
+_ImageContentInfoImpl::GetBurstShotId(void) const
+{
+ return __burstShotId;
+}
+
void
_ImageContentInfoImpl::SetWidth(int width)
{
__orientationType = orientationType;
}
+void
+_ImageContentInfoImpl::SetImageTakenDate(const DateTime& takenDate)
+{
+ __takenDate = takenDate;
+}
+
+void
+_ImageContentInfoImpl::SetBurstShot(const bool isBurst)
+{
+ __isBurst = isBurst;
+}
+
+void
+_ImageContentInfoImpl::SetBurstShotId(const String& burstShotId)
+{
+ __burstShotId = burstShotId;
+}
+
}}