SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use.");
SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty");
- SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
+ SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
"[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer());
SysTryCatch(NID_MEDIA, ((pixelFormat==BITMAP_PIXEL_FORMAT_RGB565) || (pixelFormat==BITMAP_PIXEL_FORMAT_ARGB8888) || (pixelFormat==BITMAP_PIXEL_FORMAT_R8G8B8A8)),
r = E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] pixelFormat:%d", pixelFormat);
SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use.");
SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty");
- SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
+ SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
"[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer());
SysTryCatch(NID_MEDIA, ((pixelFormat==BITMAP_PIXEL_FORMAT_RGB565) || (pixelFormat==BITMAP_PIXEL_FORMAT_ARGB8888) || (pixelFormat==BITMAP_PIXEL_FORMAT_R8G8B8A8)),
r = E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] pixelFormat:%d", pixelFormat);
SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use.");
SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty");
- SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
+ SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
"[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer());
SysTryCatch(NID_MEDIA, ((pixelFormat==BITMAP_PIXEL_FORMAT_RGB565) || (pixelFormat==BITMAP_PIXEL_FORMAT_ARGB8888) || (pixelFormat==BITMAP_PIXEL_FORMAT_R8G8B8A8)),
r = E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] pixelFormat:%d", pixelFormat);
SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use.");
SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] path is empty");
- SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
+ SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
"[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer());
SysTryCatch(NID_MEDIA, ((destImageFormat>IMG_FORMAT_NONE) && (destImageFormat<=IMG_FORMAT_WBMP)), r = E_UNSUPPORTED_FORMAT, E_UNSUPPORTED_FORMAT,
"[E_UNSUPPORTED_FORMAT] destImageFormat:%d", destImageFormat);
SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use.");
SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty");
- SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
+ SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
"[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer());
// CompressJpeg should accept only jpeg encoded images.
SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use.");
SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty");
- SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
+ SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
"[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer());
SysTryCatch(NID_MEDIA, ((pixelFormat==BITMAP_PIXEL_FORMAT_RGB565) || (pixelFormat==BITMAP_PIXEL_FORMAT_ARGB8888) || (pixelFormat==BITMAP_PIXEL_FORMAT_R8G8B8A8)),
r = E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] pixelFormat:%d", pixelFormat);
SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use.");
SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty");
- SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
+ SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
"[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer());
fmt = _ImageUtilImpl::GetImageFormat(srcImagePath);
r = GetLastResult();
SysAssertf(__pImageImpl != null, "Not yet constructed. Construct() should be called before use.");
SysTryCatch(NID_MEDIA, !srcImagePath.IsEmpty(), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] srcImagePath is empty");
- SysTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
+ SysSecureTryCatch(NID_MEDIA, File::IsFileExist(srcImagePath), r = E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
"[E_FILE_NOT_FOUND] srcImagePath:%ls", srcImagePath.GetPointer());
return _ImageUtilImpl::HasAlphaChannel(srcImagePath);
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
SysTryReturnResult(NID_MEDIA, !srcImagePath.IsEmpty(), E_INVALID_ARG,"path is empty.");
- SysTryReturnResult(NID_MEDIA, File::IsFileExist(srcImagePath), E_FILE_NOT_FOUND,
+ SysSecureTryReturnResult(NID_MEDIA, File::IsFileExist(srcImagePath), E_FILE_NOT_FOUND,
"file not found: %ls", srcImagePath.GetPointer());
_ImageBufferImpl* pImageBufferImpl = new (std::nothrow) _ImageBufferImpl();
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
SysTryReturnResult(NID_MEDIA, !srcImagePath.IsEmpty(), E_INVALID_ARG,"path is empty.");
- SysTryReturnResult(NID_MEDIA, File::IsFileExist(srcImagePath), E_FILE_NOT_FOUND,
+ SysSecureTryReturnResult(NID_MEDIA, File::IsFileExist(srcImagePath), E_FILE_NOT_FOUND,
"file not found: %ls", srcImagePath.GetPointer());
_ImageBufferImpl* pImageBufferImpl = new (std::nothrow) _ImageBufferImpl();
SysTryReturn(NID_MEDIA, !srcImagePath.IsEmpty(), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
"[E_FILE_NOT_FOUND] path is empty");
- SysTryReturn(NID_MEDIA, File::IsFileExist(srcImagePath), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
+ SysSecureTryReturn(NID_MEDIA, File::IsFileExist(srcImagePath), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND,
"[E_FILE_NOT_FOUND] file not found: %ls", srcImagePath.GetPointer());
r = _ImageBufferImpl::GetImageInfo(srcImagePath, imageFormat, width, height);
pByteBuffer.reset(_MediaUtil::FileToBufferN(filePath, 0));
r = GetLastResult();
- SysTryReturn(NID_MEDIA, pByteBuffer.get() != null, r, r, "FiltToeBufferN:%S", filePath.GetPointer());
+ SysSecureTryReturn(NID_MEDIA, pByteBuffer.get() != null, r, r, "FiltToeBufferN:%ls", filePath.GetPointer());
r = __pGifDecoder->Construct(pByteBuffer->GetPointer(), pByteBuffer->GetLimit(), pixelFormat);
if (r != E_SUCCESS)
{
std::unique_ptr<ByteBuffer> pBuf;
pBuf.reset(_MediaUtil::FileToBufferN(srcImagePath));
- SysTryReturn(NID_MEDIA, pBuf.get() != null, GetLastResult(), GetLastResult(),
- "[%s] FileToBufferN %S", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer());
+ SysSecureTryReturn(NID_MEDIA, pBuf.get() != null, GetLastResult(), GetLastResult(),
+ "[%s] FileToBufferN %ls", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer());
r = Construct(*pBuf.get(), pDecodingRegion, autoRotate);
SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] ImageBuffer construct failed.", GetErrorMessage(r));
return r;
std::unique_ptr<ByteBuffer> pBuf;
pBuf.reset(_MediaUtil::FileToBufferN(srcImagePath));
- SysTryReturn(NID_MEDIA, pBuf.get() != null, GetLastResult(), GetLastResult(),
- "[%s] FileToBufferN %S", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer());
+ SysSecureTryReturn(NID_MEDIA, pBuf.get() != null, GetLastResult(), GetLastResult(),
+ "[%s] FileToBufferN %ls", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer());
r = Construct(*pBuf.get(), destWidth, destHeight, scalingMethod);
SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] ImageBuffer construct failed.", GetErrorMessage(r));
return r;
Bitmap* pBmp = null;
pBuf.reset(_MediaUtil::FileToBufferN(srcImagePath));
- SysTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(),
- "[%s] FileToBufferN %S", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer());
+ SysSecureTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(),
+ "[%s] FileToBufferN %ls", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer());
pBmp = DecodeToBitmapN(*pBuf.get(), pixelFormat);
return pBmp;
Bitmap* pBmp = null;
pBuf.reset(_MediaUtil::FileToBufferN(srcImagePath));
- SysTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(),
- "[%s] FileToBufferN %S", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer());
+ SysSecureTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(),
+ "[%s] FileToBufferN %ls", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer());
pBmp = DecodeToBitmapN(*pBuf.get(), pixelFormat, destDim, bufferScaling);
return pBmp;
Bitmap* pBmp = null;
pBuf.reset(_MediaUtil::FileToBufferN(srcImagePath));
- SysTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(),
- "[%s] FileToBufferN %S", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer());
+ SysSecureTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(),
+ "[%s] FileToBufferN %ls", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer());
pBmp = DecodeToBitmapN(*pBuf.get(), pixelFormat, destDim);
return pBmp;
//"[E_OUT_OF_RANGE] dest dimension:%d,%d", dstDim.width, dstDim.height);
pBuf.reset(_MediaUtil::FileToBufferN(srcImagePath));
- SysTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(),
- "[%s] FileToBufferN %S", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer());
+ SysSecureTryReturn(NID_MEDIA, pBuf.get() != null, null, GetLastResult(),
+ "[%s] FileToBufferN %ls", GetErrorMessage(GetLastResult()), srcImagePath.GetPointer());
pRetBuf = DecodeToBufferN(*pBuf.get(), restDim, dstDim, pixelFormat, imgFormat, keepAspectRatio);
return pRetBuf;
SysTryCatch(NID_MEDIA, __pRequestImpl != null, r = GetLastResult(), GetLastResult(),
"[%s] Failed to get the managed httprequest.", GetErrorMessage(GetLastResult()));
- SysLog(NID_MEDIA, "Uri = %S", downloadUri.ToString().GetPointer());
+ SysSecureLog(NID_MEDIA, "Uri = %ls", downloadUri.ToString().GetPointer());
r = __pRequestImpl->SetUri(downloadUri.ToString());
SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Failed to set uri into the HTTP request.", GetErrorMessage(r));