MessageComposePanel::Run(void)
{
AppLogDebug("ENTER");
+ ExifOrientation imgOrientation;
+// Tizen::Content::ImageMetadata* pImageMeta = null;
+ ImageFormat imgFormat;
+ int height, width;
MsgResponse status(MSG_RESPONSE_RESIZE_IMAGE);
// Copy To MMS compose temp file.
mmsDataPath.Append(File::GetFileName(__pSelectFilePath));
AppLogDebug("MMS DATA PATH: %S", mmsDataPath.GetPointer());
result r = E_SUCCESS;
- //__pOriginalFilePath = __pSelectFilePath;
+ __pOriginalFilePath = __pSelectFilePath;
r = File::Copy(__pSelectFilePath, mmsDataPath, true);
AppLogDebug("File to inserted copy result : %s ",GetErrorMessage(r));
int i = 0;
status = MSG_RESPONSE_FAIL;
}
+
+ if (__pSelectFilePath.EndsWith(L".jpg") || __pSelectFilePath.EndsWith(L".jpeg"))
+ {
+ ImageBuffer::GetImageInfo(__pSelectFilePath, imgFormat, width, height);
+ ImageBuffer* pImageBuffer = new (std::nothrow) ImageBuffer();
+ r = pImageBuffer->Construct(__pSelectFilePath);
+ ImageBuffer* pOriginalImageBuffer = new (std::nothrow) ImageBuffer();
+ r = pOriginalImageBuffer->Construct(__pOriginalFilePath, width, height, IMAGE_SCALING_METHOD_FAST_BILINEAR );//Construct(__pOriginalFilePath);
+
+ if (pOriginalImageBuffer && pImageBuffer)
+ {
+ imgOrientation = pOriginalImageBuffer->GetExifOrientation();
+ AppLog("ExifOrientation = %d", pOriginalImageBuffer->GetExifOrientation());
+
+ if (imgOrientation == EXIF_ORIENTATION_RIGHT_TOP ||
+ imgOrientation == EXIF_ORIENTATION_TOP_RIGHT )
+ {
+ pImageBuffer = pImageBuffer->RotateN(IMAGE_ROTATION_90);
+ r = pImageBuffer->EncodeToFile(__pSelectFilePath, IMG_FORMAT_JPG, true, 70);
+ }
+ else if (imgOrientation == EXIF_ORIENTATION_RIGHT_BOTTOM ||
+ imgOrientation == EXIF_ORIENTATION_BOTTOM_RIGHT)
+ {
+ pImageBuffer = pImageBuffer->RotateN(IMAGE_ROTATION_180);
+ r = pImageBuffer->EncodeToFile(__pSelectFilePath, IMG_FORMAT_JPG, true, 70);
+ }
+ else if (imgOrientation == EXIF_ORIENTATION_LEFT_BOTTOM ||
+ imgOrientation == EXIF_ORIENTATION_BOTTOM_LEFT)
+ {
+ pImageBuffer = pImageBuffer->RotateN(IMAGE_ROTATION_270);
+ r = pImageBuffer->EncodeToFile(__pSelectFilePath, IMG_FORMAT_JPG, true, 70);
+ }
+ delete pImageBuffer;
+ delete pOriginalImageBuffer;
+ }
+ }
+
// Send event to main thread from worker thread.
ArrayList* pArgList = new ArrayList();
pArgList->Construct();