Bug 185317 - Album thumbnails are gone when moving nested albums
Summary: Album thumbnails are gone when moving nested albums
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Thumbs-Image (show other bugs)
Version: 1.0.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-23 10:59 UTC by Andi Clemens
Modified: 2017-07-27 11:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andi Clemens 2009-02-23 10:59:05 UTC
Version:           0.11.0-svn (using 4.2.00 (KDE 4.2.0), Arch Linux)
Compiler:          gcc
OS:                Linux (i686) release 2.6.28-ARCH

When I move single folder albums around, their thumbnail is kept when displayed in the new location.
But when I move nested albums around, I loose ALL my thumbnails in this album hierarchy.

For example:
A
B
C
|- D
|- E

Moving album D -> A or A -> B works fine, also B -> E is ok.
But if I move C -> A for example, all album thumbnails are gone, so I need to set them again for folder C, D and E.

Andi

(and again, valid for 0.10)
Comment 1 Andi Clemens 2009-02-23 11:01:51 UTC
(In reply to comment #0)
> But when I move nested albums around, I loose ALL my thumbnails in this album
> hierarchy.

Must be:
"... I loose ALL my ALBUM thumbnails in this album hierarchy..."

BTW this is a big problem, I moved a nested hierarchy of 35 albums around, now I can set all the thumbnails again. We should try to fix this for 0.10 release, it can be very annoying.
Comment 2 Andi Clemens 2009-02-23 11:03:42 UTC
The same is true when moving around collections, but then it doesn't matter if single or nested album, they get destroyed all the time.
Comment 3 Marcel Wiesweg 2009-02-23 21:24:24 UTC
Look at thumbnailcreator.cpp and thumbnailbasic.cpp in libs/threadimageio.
According to freedesktop's specification, the name of the thumbnail is computed from an MD5 hash of the file path - from the full file path.

As far as I know no thumbnails are ever moved when a file is moved, so any change in the file paths would cause thumbnail recomputation. Or is there a piece of code somewhere that I am missing?

We can of course implement a thumbnail renaming functionality. Would need to be triggered from dio.cpp. After a double check that the move operations from within digikam all use a digikamalbums:// url it could be put into the copy and rename methods of the ioslave.

When a move is done from outside digikam, we will recognize the files by checksum and could use that information as well. (This includes the case above). Perhaps this is the better method. But we need to build a bridge from the collection scanner to a place that knows about thumbnails
Comment 4 Andi Clemens 2009-02-23 21:31:27 UTC
But why is it working when I move none nested albums?
To make it clear again: I'm talking about the folder / album thumbnails, not the file thumbnails. They are always recomputed (when moved), which is logical.
Comment 5 Marcel Wiesweg 2009-02-23 23:13:01 UTC
Ah, album thumbnails. That's different ;-))
Will look into that the next days. That's really a bug then which needs to be solved.
Comment 6 Arnd Baecker 2009-02-23 23:35:12 UTC
See also:
https://bugs.kde.org/show_bug.cgi?id=94562

If I remember correctly, the thumbnails also store the location
of the original image in their metadata.
So of one moves the original images around, and renames the thumbs
accordingly, the meta-info has to be corrected as well.
Comment 7 Marcel Wiesweg 2009-02-26 08:45:05 UTC
SVN commit 931901 by mwiesweg:

Fix recording hints for the copy or move of children of the moved album.
The dst path was not adjusted properly.

CCBUG: 185317

 M  +6 -1      scancontroller.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=931901
Comment 8 Andi Clemens 2009-02-26 10:46:11 UTC
It seems to be fixed... But there is another problem with thumbnails (in iconview), I will open another report for that.

Andi
Comment 9 Andi Clemens 2009-02-26 10:48:43 UTC
Marcel,

will you backport this to 0.10 or is it too risky?

Andi
Comment 10 Marcel Wiesweg 2009-02-26 19:19:19 UTC
SVN commit 932477 by mwiesweg:

Backport:
Fix recording hints for the copy or move of children of the moved album.
The dst path was not adjusted properly.

CCBUG: 185317

 M  +6 -1      scancontroller.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=932477
Comment 11 Andi Clemens 2009-03-07 13:24:26 UTC
I will re-open this one because it is also true if you rename a parent folder.
All album thumbnails of the children will get lost when renaming the parent.

Andi
Comment 12 Marcel Wiesweg 2009-03-11 13:14:56 UTC
SVN commit 938132 by mwiesweg:

When renaming the parent album, the parentPath of child albums need to be adjusted.
Then renaming in db is really done with a new name, not with the same name again.

CCBUG: 185317

 M  +4 -1      albummanager.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=938132
Comment 13 Andi Clemens 2009-03-11 13:54:38 UTC
SVN commit 938145 by aclemens:

backport:
When renaming the parent album, the parentPath of child albums need to be adjusted.
Then renaming in db is really done with a new name, not with the same name again.

BUG: 185317

 M  +4 -1      albummanager.cpp  


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