--- digikam/digikam/albumiconview.cpp.orig	2005-08-20 20:20:42.456678320 -0700
+++ digikam/digikam/albumiconview.cpp	2005-10-01 15:12:38.998267848 -0700
@@ -48,6 +48,7 @@
 #include <qdict.h>
 #include <qdatastream.h>
 #include <qtimer.h>
+#include <qdir.h>
 
 // KDE includes.
 
@@ -68,6 +69,7 @@
 #include <kstandarddirs.h>
 #include <kdebug.h>
 #include <kiconeffect.h>
+#include <kmdcodec.h>
 
 #include <kdeversion.h>
 #if KDE_IS_VERSION(3,2,0)
@@ -1548,6 +1550,8 @@
     // we do two things here:
     // 1. refresh the timestamp
     // 2. refresh the thumbnails
+
+    QString thumbCacheDir = QDir::homeDirPath() + "/.thumbnails/";
     
     for (KURL::List::const_iterator it = urlList.begin();
          it != urlList.end(); ++it)
@@ -1561,6 +1565,21 @@
         {
             iconItem->time_ = st.st_mtime;
         }
+
+
+        // remove the items from the thumbnail cache directory as well.
+        // this is needed as jpeglossless plugin, for eg, preserves the
+        // timestamp and the thumbnailer relies on timestamp to decide
+        // whether to generate new thumbnails or not
+        QString uri = "file://" + QDir::cleanDirPath((*it).path());
+        KMD5 md5(QFile::encodeName(uri));
+        uri = md5.hexDigest();
+        
+        QString smallThumbPath = thumbCacheDir + "normal/" + uri + ".png";
+        QString bigThumbPath   = thumbCacheDir + "large/"  + uri + ".png";
+        
+        ::unlink(QFile::encodeName(smallThumbPath));
+        ::unlink(QFile::encodeName(bigThumbPath));
     }
     
     if (d->thumbJob.isNull())
