[Digikam-devel] extragear/graphics/digikam

Gilles Caulier caulier.gilles at free.fr
Tue Mar 28 14:57:26 BST 2006


SVN commit 523551 by cgilles:

digikam from trunk : BugFix

- Image Editor : Old implementation do not use 'Set Exif Orientation tag to normal after rotate/flip' option from Setup. The tag always forced to Normal. This commit fix this problem. Note that the option is enable by default.
- Showfoto : new Exif options on setup like digiKam to set and read Exif orientation tag.

Note : with this commit, Iamge Editor and Showfoto have _exactly_ the same core rules

CCMAIL: digikam-devel at kde.org

 M  +1 -1      TODO  
 M  +32 -12    showfoto/setup/setupeditor.cpp  
 M  +8 -1      showfoto/showfoto.cpp  
 M  +4 -2      utilities/imageeditor/editor/editorwindow.cpp  
 M  +2 -1      utilities/imageeditor/editor/editorwindow.h  
 M  +1 -0      utilities/imageeditor/editor/editorwindowprivate.h  
 M  +1 -0      utilities/imageeditor/editor/imagewindow.cpp  


--- trunk/extragear/graphics/digikam/TODO #523550:523551
@@ -22,7 +22,7 @@
    - albumiconview.cpp    lines 1296 and 1298.
    - jpegmetadata.cpp     line 143.
    - exifrotate.cpp       lines 74 and 210.
-   
+      
 * post conversion to qlistview: allow selection of multiple
   albums/tags/dates :
 
--- trunk/extragear/graphics/digikam/showfoto/setup/setupeditor.cpp #523550:523551
@@ -52,12 +52,14 @@
 
     SetupEditorPriv()
     {
-        backgroundColor    = 0;
-        hideToolBar        = 0;
-        hideThumbBar       = 0;
-        horizontalThumbBar = 0;
-        showSplash         = 0;
-        useTrash           = 0;
+        backgroundColor       = 0;
+        hideToolBar           = 0;
+        hideThumbBar          = 0;
+        horizontalThumbBar    = 0;
+        showSplash            = 0;
+        useTrash              = 0;
+        exifRotateBox         = 0;
+        exifSetOrientationBox = 0;
     }
 
     QCheckBox    *hideToolBar;
@@ -65,6 +67,8 @@
     QCheckBox    *horizontalThumbBar;
     QCheckBox    *showSplash;
     QCheckBox    *useTrash;
+    QCheckBox    *exifRotateBox;
+    QCheckBox    *exifSetOrientationBox;
     
     KColorButton *backgroundColor;
 };
@@ -86,14 +90,14 @@
     d->backgroundColor = new KColorButton(colorBox);
     backgroundColorlabel->setBuddy(d->backgroundColor);
     QWhatsThis::add( d->backgroundColor, i18n("<p>Select here the background color to use "
-                                                "for image editor area.") );
+                                              "for image editor area.") );
     backgroundColorlabel->setBuddy( d->backgroundColor );
     
-    d->hideToolBar     = new QCheckBox(i18n("H&ide toolbar in fullscreen mode"), interfaceOptionsGroup);
-    d->hideThumbBar    = new QCheckBox(i18n("Hide &thumbbar in fullscreen mode"), interfaceOptionsGroup);
-    d->horizontalThumbBar     = new QCheckBox(i18n("Use &horizontal thumbbar (need to restart showFoto)"), interfaceOptionsGroup);
+    d->hideToolBar        = new QCheckBox(i18n("H&ide toolbar in fullscreen mode"), interfaceOptionsGroup);
+    d->hideThumbBar       = new QCheckBox(i18n("Hide &thumbbar in fullscreen mode"), interfaceOptionsGroup);
+    d->horizontalThumbBar = new QCheckBox(i18n("Use &horizontal thumbbar (need to restart showFoto)"), interfaceOptionsGroup);
     QWhatsThis::add( d->horizontalThumbBar, i18n("<p>If this option is enable, thumbnails bar will be displayed horizontally behind "
-                                            "image area. You need to restart showFoto for this option take effect.<p>"));
+                                                 "image area. You need to restart showFoto for this option take effect.<p>"));
     d->useTrash   = new QCheckBox(i18n("&Deleting items should move them to trash"), interfaceOptionsGroup);
     d->showSplash = new QCheckBox(i18n("&Show splash screen at startup"), interfaceOptionsGroup);
     
@@ -101,6 +105,18 @@
         
     // --------------------------------------------------------
     
+    QVGroupBox *ExifGroupOptions = new QVGroupBox(i18n("Exif Actions"), parent);
+    
+    d->exifRotateBox = new QCheckBox(ExifGroupOptions);
+    d->exifRotateBox->setText(i18n("&Rotate images according to EXIF tag"));
+  
+    d->exifSetOrientationBox = new QCheckBox(ExifGroupOptions);
+    d->exifSetOrientationBox->setText(i18n("Set &EXIF orientation tag to normal after rotate/flip"));
+        
+    layout->addWidget(ExifGroupOptions);
+    
+    // --------------------------------------------------------
+    
     layout->addStretch();
     
     readSettings();
@@ -122,6 +138,8 @@
     config->writeEntry("HorizontalThumbbar", d->horizontalThumbBar->isChecked());
     config->writeEntry("DeleteItem2Trash", d->useTrash->isChecked());
     config->writeEntry("ShowSplash", d->showSplash->isChecked());
+    config->writeEntry("EXIF Rotate", d->exifRotateBox->isChecked());
+    config->writeEntry("EXIF Set Orientation", d->exifSetOrientationBox->isChecked());
     config->sync();
 }
 
@@ -137,7 +155,9 @@
     d->horizontalThumbBar->setChecked(config->readBoolEntry("HorizontalThumbbar", false));
     d->useTrash->setChecked(config->readBoolEntry("DeleteItem2Trash", false));
     d->showSplash->setChecked(config->readBoolEntry("ShowSplash", true));
-
+    d->exifRotateBox->setChecked(config->readBoolEntry("EXIF Rotate", true));
+    d->exifSetOrientationBox->setChecked(config->readBoolEntry("EXIF Set Orientation", true));
+    
     delete Black;
 }
 
--- trunk/extragear/graphics/digikam/showfoto/showfoto.cpp #523550:523551
@@ -365,7 +365,9 @@
         m_fileDeleteAction->setText(i18n("Delete File"));
     }
 
-    m_canvas->setExifOrient(false);
+    m_canvas->setExifOrient(config->readBoolEntry("EXIF Rotate", true));
+    m_setExifOrientationTag = config->readBoolEntry("EXIF Set Orientation", true);
+    
     m_fullScreenHideThumbBar = config->readBoolEntry("FullScreenHideThumbBar", true);
 }
 
@@ -523,6 +525,9 @@
     m_undoAction->setEnabled(moreUndo);
     m_redoAction->setEnabled(moreRedo);
     m_saveAction->setEnabled(canSave);
+    
+    if (!moreUndo)
+        m_rotatedOrFlipped = false;        
 }
 
 void ShowFoto::toggleActions(bool val)
@@ -587,6 +592,8 @@
 void ShowFoto::slotUpdateItemInfo(void)
 {
     m_itemsNb = m_bar->countItems();
+    
+    m_rotatedOrFlipped = false;
     int index = 0;
     QString text;
     
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.cpp #523550:523551
@@ -112,6 +112,7 @@
     m_slideShowAction        = 0;
     m_fullScreen             = false;
     m_rotatedOrFlipped       = false;
+    m_setExifOrientationTag  = true;
     
     // Settings containers instance.
 
@@ -1162,7 +1163,8 @@
             return;
         }
 
-        if( m_rotatedOrFlipped || m_canvas->exifRotated() )
+        
+        if( m_setExifOrientationTag && (m_rotatedOrFlipped || m_canvas->exifRotated()) )
         {
             DMetadata metadata;
             metadata.writeExifImageOrientation(m_savingContext->saveTempFile->name(), DMetadata::ORIENTATION_NORMAL);
@@ -1214,7 +1216,7 @@
         if (QString(QImageIO::imageFormat(m_savingContext->srcURL.path())).upper() == "JPEG" &&
             m_savingContext->format.upper() == "JPEG")
         {
-            if( m_rotatedOrFlipped || m_canvas->exifRotated() )
+            if( m_setExifOrientationTag && (m_rotatedOrFlipped || m_canvas->exifRotated()) )
             {
                DMetadata metadata;
                metadata.writeExifImageOrientation(m_savingContext->saveTempFile->name(), DMetadata::ORIENTATION_NORMAL);
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.h #523550:523551
@@ -72,7 +72,8 @@
 
     bool                     m_fullScreen;
     bool                     m_rotatedOrFlipped;
-    
+    bool                     m_setExifOrientationTag;
+   
     QLabel                  *m_zoomLabel;
     QLabel                  *m_resLabel;
 
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindowprivate.h #523550:523551
@@ -45,6 +45,7 @@
         removeFullScreenButton = false;
         fullScreenHideToolBar  = false;
         slideShowInFullScreen  = true;
+        
         imagePluginsHelpAction = 0;
         accelerators           = 0;
         viewHistogramAction    = 0;
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/imagewindow.cpp #523550:523551
@@ -259,6 +259,7 @@
     }
 
     m_canvas->setExifOrient(settings->getExifRotate());
+    m_setExifOrientationTag = settings->getExifSetOrientation();
 }
 
 void ImageWindow::loadURL(const KURL::List& urlList, const KURL& urlCurrent,



More information about the Digikam-devel mailing list