[Digikam-devel] [Bug 147260] digikam image view does not rotate images in album view, thumbs are correct

Marcel Wiesweg marcel.wiesweg at gmx.de
Mon Jul 2 17:48:50 BST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=147260         




------- Additional Comments From marcel.wiesweg gmx de  2007-07-02 18:48 -------
SVN commit 682425 by mwiesweg:

Handle raw embedded preview differently than raw images loaded by dcraw
(either in full or half size mode).
Thanks to Andrew Dodd for bug hunting.

CCBUG: 147260


 M  +2 -1      loadsavethread.cpp  
 M  +23 -9     previewtask.cpp  


--- branches/extragear/kde3/graphics/digikam/libs/threadimageio/loadsavethread.cpp #682424:682425
 @ -211,7 +211,8  @
     // Raw files are already rotated properlly by dcraw. Only perform auto-rotation with JPEG/PNG/TIFF file.
     // We don't have a feedback from dcraw about auto-rotated RAW file during decoding. Return true anyway.
 
-    if (DImg::fileFormat(filePath) == DImg::RAW)
+    attribute = image.attribute("fromRawEmbeddedPreview");
+    if (DImg::fileFormat(filePath) == DImg::RAW && !(attribute.isValid() && attribute.toBool()) )
     {
         return true;
     }
--- branches/extragear/kde3/graphics/digikam/libs/threadimageio/previewtask.cpp #682424:682425
 @ -138,34 +138,48  @
 
     DImg img;
     QImage qimage;
+    bool fromEmbeddedPreview = false;
 
     // -- Get the image preview --------------------------------
 
     // First the QImage-dependent loading methods
     // Trying to load with dcraw: RAW files.
-    if ( !KDcrawIface::KDcraw::loadDcrawPreview(qimage, m_loadingDescription.filePath) )
+    if (KDcrawIface::KDcraw::loadEmbeddedPreview(qimage, m_loadingDescription.filePath))
+        fromEmbeddedPreview = true;
+
+    if (qimage.isNull())
     {
-        // Try to extract Exif/Iptc preview.
-        loadImagePreview(qimage, m_loadingDescription.filePath);
+        //TODO: Use DImg based loader instead?
+        KDcrawIface::KDcraw::loadEmbeddedPreview(qimage, m_loadingDescription.filePath);
     }
 
-    // DImg-dependent loading methods
+    // Try to extract Exif/Iptc preview.
     if (qimage.isNull())
     {
-        // Set a hint to try to load a JPEG with the fast scale-before-decoding method
-        img.setAttribute("jpegScaledLoadingSize", size);
-        img.load(m_loadingDescription.filePath, this, m_loadingDescription.rawDecodingSettings);
+        loadImagePreview(qimage, m_loadingDescription.filePath);
     }
-    else
+
+    if (!qimage.isNull())
     {
         // convert from QImage
         img = DImg(qimage);
+        // mark as embedded preview (for exif rotation)
+        if (fromEmbeddedPreview)
+            img.setAttribute("fromRawEmbeddedPreview", true);
         // free memory
-        qimage.reset();
+        qimage = QImage();
     }
 
+    // DImg-dependent loading methods
     if (img.isNull())
     {
+        // Set a hint to try to load a JPEG with the fast scale-before-decoding method
+        img.setAttribute("jpegScaledLoadingSize", size);
+        img.load(m_loadingDescription.filePath, this, m_loadingDescription.rawDecodingSettings);
+    }
+
+    if (img.isNull())
+    {
         DWarning() << "Cannot extract preview for " << m_loadingDescription.filePath << endl;
     }



More information about the Digikam-devel mailing list