Nabi issue fix for .ico image
[apps/osp/ImageViewer.git] / src / IvImageCropForm.cpp
index 7fb4c90..1c2a5f1 100644 (file)
@@ -147,6 +147,7 @@ void
 ImageCropForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
 {
        AppLogDebug("ENTER pArgs(%x)", pArgs);
+
        if (pArgs != null)
        {
                __sourceFilePath = *(static_cast<String*>(pArgs->GetAt(0)));
@@ -210,6 +211,7 @@ void
 ImageCropForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
 {
        AppLogDebug("ENTER");
+       __pPresentationModel->RemoveFileUpdateListener(*this);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -260,6 +262,20 @@ ImageCropForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
 
        case IDA_BUTTON_SAVE:
        {
+               ImageBuffer imageBuffer;
+               result r = imageBuffer.Construct(__sourceFilePath);
+
+               if (r != E_SUCCESS)
+               {
+                       MessageBox messageBox;
+                       messageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_BODY_UNSUPPORTED_FILE_TYPE"), MSGBOX_STYLE_NONE, 3000);
+                       int modalResult = 0;
+                       messageBox.ShowAndWait(modalResult);
+                       UiApp* pApp = UiApp::GetInstance();
+                       pApp->Terminate();
+                       return;
+               }
+
                if (File::IsFileExist(__sourceFilePath))
                {
                        ImageViewerApp* pApp = dynamic_cast<ImageViewerApp*>(UiApp::GetInstance());
@@ -995,7 +1011,8 @@ ImageCropForm::SetValue(void)
        __pCanvas->SetForegroundColor(CROP_BOX_RECTANGLE_COLOR);
 }
 
-void ImageCropForm::OnFormFileEventOccuered(const int index, const unsigned long eventId)
+void
+ImageCropForm::OnFormFileEventOccuered(const int index, const unsigned long eventId)
 {
        AppLogDebug(" ENTER");
        UiApp::GetInstance()->Terminate();