Bug 189742 - Thumbnails not saved between sessions
Summary: Thumbnails not saved between sessions
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Thumbs-Image (show other bugs)
Version: 1.0.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-15 21:13 UTC by David Eriksson
Modified: 2017-06-29 14:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 1.0.0


Attachments
Patch to fix renaming of thumbnail (1.07 KB, patch)
2009-06-20 21:34 UTC, David Eriksson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Eriksson 2009-04-15 21:13:12 UTC
Version:           0.11.0-svn (using 4.2.2 (KDE 4.2.2), MinGW 3.4.5)
Compiler:          gcc.exe
OS:                Microsoft Windows (i686) release 5.1 (XP Professional)

Every time I start digiKam on Windows all thumbnails have to be regenereted. On Linux the thumbnails are saved between sessions so that next time I start digiKam the thumbnails are there from the start.
Comment 1 Mikolaj Machowski 2009-04-15 21:43:36 UTC
Confirming. I spend over 1h to generate all thumbnails and after restart there was nothing :(

Problems with finding/creation of .thumbnails directory? In my case it was created by GIMP.
Comment 2 caulier.gilles 2009-04-18 16:06:59 UTC
I confirm this bug under M$ Vista too...

Gilles Caulier
Comment 3 caulier.gilles 2009-04-18 16:13:15 UTC
Marcel,

It sound like a similar problem fixed with commit #941531 in others digiKam parts:

http://websvn.kde.org/?view=rev&revision=941531

Of course commit #941531 do not include digikam/libs/threadimageio where i suspect problem is located.

Gilles
Comment 4 Patrick Spendrin 2009-05-06 17:45:56 UTC
ok, I am currently working on this bug - the problem seems to be that renaming the temporary files doesn't work as expected: in my .thumbnails folder hundreds of kde-tmp-????.png files do exist. these are the generated thumbnails, but they should instead be named as the md5 hash of the orginal file name.
Comment 5 Patrick Spendrin 2009-05-07 01:21:55 UTC
SVN commit 964603 by sengels:

fix thumbnailing:
the problem was that KTemporaryFile kept the file in use, so renaming didn't work under Windows.
I fixed this bug already twice - the same code is spread all over KDE, so it might make sense if we can unify that using previewjob from kdelibs/kio.
BUG:189742

 M  +10 -3     thumbnailcreator.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=964603
Comment 6 caulier.gilles 2009-05-07 12:11:26 UTC
Mik, David,

I think this bug is fixed under Windows (I will test at home on XP and Vista this WE)

Gilles
Comment 7 David Eriksson 2009-05-07 21:35:47 UTC
It does not work, at the moment broken on both Windows and Linux. There is an missing
        temp.setAutoRemove(false);

David
Comment 8 caulier.gilles 2009-05-09 11:08:36 UTC
SVN commit 965527 by cgilles:

Temp file don not be deleted automatically. It's renamed just after...
Tested under Linux. Look like thumbs is really faster now. Sound like we have this bug since KDE4 port is started (summer 2007)
CCBUGS: 189742


 M  +1 -4      thumbnailcreator.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=965527
Comment 9 David Eriksson 2009-06-20 21:33:31 UTC
Reopened since the new code in ThumbnailCreator::storeFreedesktop has the same behavior. The KTemporaryFile object has to be destroyed before renaming the file, Windows doesn't allow renaming of open file.

Attached patch fixes the problem.
Comment 10 David Eriksson 2009-06-20 21:34:26 UTC
Created attachment 34693 [details]
Patch to fix renaming of thumbnail
Comment 11 Marcel Wiesweg 2009-12-06 17:34:48 UTC
SVN commit 1059431 by mwiesweg:

Close file before moving. According to bug report seems to be necessary for Windows.
Note: With thumbs db the default, this code is not much used.

BUG: 189742

 M  +2 -0      thumbnailcreator.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1059431