[Digikam-devel] [Bug 145198] light-table should also work with the full image

Gilles Caulier caulier.gilles at gmail.com
Mon May 21 22:05:27 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=145198         




------- Additional Comments From caulier.gilles gmail com  2007-05-21 23:05 -------
SVN commit 667096 by cgilles:

digiKam from trunk : Light Table preview : fix tile side effect with high zoom level. This is a first approach how to solv ethis problem. It's not optimum but work fine.

What the problem exactly ? Well it's simple : we scaling a part of full image to render a preview unsing a tile matrix. The part of ful image is scaled with take a care of 
image data outside the region. With a high zoom level the scale algorithm cannot compute properlly the border of the tile and a side effect appear.

CCBUGS: 145198


 M  +24 -5     lighttablepreview.cpp  


--- trunk/extragear/graphics/digikam/utilities/lighttable/lighttablepreview.cpp #667095:667096
 @ -218,6 +218,15  @
 
 void LightTablePreview::setPreviousNextPaths(const QString& previous, const QString &next)
 {
+    if (d->previewPreloadThread)
+    {
+        // stop preloading, but only if the loading is no longer needed
+        if (d->nextPath != d->path && d->nextPath != next && d->nextPath != previous)
+            d->previewPreloadThread->stopLoading(d->nextPath);
+        if (d->previousPath != d->path && d->previousPath != previous && d->previousPath != next)
+            d->previewPreloadThread->stopLoading(d->previousPath);
+    }
+
     d->nextPath     = next;
     d->previousPath = previous;
 }
 @ -281,7 +290,16  @
     }
 
     unsetCursor();
-    slotNextPreload();
+
+    if (description.previewParameters.size != 0)
+    {
+        d->previewThread->loadHighQuality(LoadingDescription(description.filePath,
+                                          0, AlbumSettings::instance()->getExifRotate()));
+    }
+    else
+    {
+        slotNextPreload();
+    }
 }
 
 void LightTablePreview::slotNextPreload()
 @ -300,7 +318,7  @
     else
         return;
 
-    d->previewPreloadThread->load(LoadingDescription(loadPath, d->previewSize,
+    d->previewPreloadThread->loadHighQuality(LoadingDescription(loadPath, 0,
                                   AlbumSettings::instance()->getExifRotate()));
 }
 
 @ -645,9 +663,10  @
 
 void LightTablePreview::paintPreview(QPixmap *pix, int sx, int sy, int sw, int sh)
 {
-    // Fast smooth scale method from Antonio.   
-    QImage img = FastScale::fastScaleQImage(d->preview.copy(sx, sy, sw, sh),
-                                            tileSize(), tileSize());
+    QImage img = FastScale::fastScaleQImage(d->preview.copy(sx-sw/10, sy-sh/10, sw+sw/5, sh+sh/5), 
+                                            tileSize()+tileSize()/5, tileSize()+tileSize()/5)
+                           .copy(tileSize()/10, tileSize()/10, tileSize(), tileSize());
+
     bitBlt(pix, 0, 0, &img, 0, 0);
 }



More information about the Digikam-devel mailing list