[KPhotoAlbum] Performance observations

Robert Krawitz rlk at alum.mit.edu
Mon May 14 00:52:59 BST 2018


Found one reason why the thumbnails were so slow...it wasn't using the
optimized JPEG loader.  This one liner fixes that.

diff --git a/Utilities/Util.cpp b/Utilities/Util.cpp
index 9ded1a73..5adfdd8f 100644
--- a/Utilities/Util.cpp
+++ b/Utilities/Util.cpp
@@ -626,7 +626,7 @@ bool Utilities::loadJPEG(QImage *img, FILE* inputFile, QSize* fullSize, int dim
 
 bool Utilities::isJPEG( const DB::FileName& fileName )
 {
-    QString format= QString::fromLocal8Bit( QImageReader::imageFormat( fileName.relative() ) );
+    QString format= QString::fromLocal8Bit( QImageReader::imageFormat( fileName.absolute() ) );
     return format == QString::fromLocal8Bit( "jpeg" );
 }
 
Not done with everything yet.  There is a bug, fortunately with an
easy fix, that results in most new files being duplicated in the
index.

-- 
Robert Krawitz                                     <rlk at alum.mit.edu>

***  MIT Engineers   A Proud Tradition   http://mitathletics.com  ***
Member of the League for Programming Freedom  --  http://ProgFree.org
Project lead for Gutenprint   --    http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton



More information about the Kphotoalbum mailing list