Bug 329608 - Thumbnail of picture in dolphin never updated after picture manipulation
Summary: Thumbnail of picture in dolphin never updated after picture manipulation
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Portability-Interroperability (show other bugs)
Version: 3.5.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-04 22:27 UTC by Nicofo
Modified: 2017-08-12 06:32 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.0.0


Attachments
Thumbnail (incorrect) - Preview (correct) (70.35 KB, image/jpeg)
2014-01-04 22:27 UTC, Nicofo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicofo 2014-01-04 22:27:02 UTC
The thumbnail of pictures are not updated after picture manipulation outside dolphin (rotation in digikam).

Reproducible: Always

Steps to Reproduce:
1. In dolphin, activate the preview mode in a directory containing pictures
2. Modify a picture (I use digikam to rotate a picture)
3. Go back to dolphin -> the picture thumbnail is never refreshed (even after F5). However the preview in the information panel is correct.  ->  see screenshot in attachment [the preview in the right is correct ; the thumbnail in the left is not].



If I rename or move the picture -> the thumbnail is recreated and is correct.
If I re-rename the file to its original name -> the thumbnail is incorrect again.
Comment 1 Nicofo 2014-01-04 22:27:44 UTC
Created attachment 84456 [details]
Thumbnail (incorrect) - Preview (correct)
Comment 2 Frank Reininghaus 2014-01-05 18:33:19 UTC
Thanks for the bug report. I can confirm this in Dolphin 4.12.0.

Funnily enough, I first tried it with Gwenview, and then the preview in the view was updated immediately, but the one in the Information Panel was not. (One could fix this Information Panel issue in principle and have the preview in the Panel also updated immediately. However, nobody has ever complained about this behavior AFAIK, so I'm not sure if it's worth the increased code complexity that would be required for a proper fix.)

I doubt that it's a bug in Dolphin though. Might be an issue in kdelibs.
Comment 3 Frank Reininghaus 2014-01-05 18:35:47 UTC
OK, I see what the problem is. This is a Digikam bug.

Digikam preserves the file's modification time when rotating, even though the file has clearly been modified. Therefore, the thumbnailing code in KIO has no chance to detect that the preview that is stored in ~/.thumbnails (which appears to be newer than the image!) is outdated.
Comment 4 caulier.gilles 2014-01-05 18:38:37 UTC
How do you rotate the picture in digiKam ? Through icon view, image editor, or Batch Queue Manager ?

Gilles Caulier
Comment 5 Frank Reininghaus 2014-01-05 18:41:18 UTC
I did it by clicking the little "turning arrow icon" in the top-right corner of the image's thumbnail in the icon view.
Comment 6 caulier.gilles 2014-01-05 18:51:59 UTC
Ok, so it's outside image editor and BQM.

Can you confirm that problem do not occurs if you rotate in digiKam Editor or BQM ?

Gilles Caulier
Comment 7 Frank Reininghaus 2014-01-05 18:58:02 UTC
I've tried all different methods now. The modification time of the modified image is always the original time here.

Maybe this is done because some users prefer to have "modification time" == "time when the picture was taken", which I can understand somehow. But this approach is confusing for code that is expected to react to changes of the image file.
Comment 8 caulier.gilles 2014-01-05 19:01:49 UTC
Go to digiKam setup/metadata and turn on "Update file timestamp when metadata is saved" option to see if it's fix the problem (it must normaly)

Gilles Caulier
Comment 9 Nicofo 2014-01-06 19:44:23 UTC
Thank you for your investigations.

1)  (In reply to comment #3)
> OK, I see what the problem is. This is a Digikam bug.
> 
> Digikam preserves the file's modification time when rotating, even though
> the file has clearly been modified. Therefore, the thumbnailing code in KIO
> has no chance to detect that the preview that is stored in ~/.thumbnails
> (which appears to be newer than the image!) is outdated.

I disagree with you: I use digikam to rotate my picture precisely because it does not update the file's modification. This is so useful when sorting files in dolphin !
However you are right, the bug occurs because the modification time remains the same (which is what I want). If I "touch" the file (from command line) -> the preview is well updated in dolphin.

2) (In reply to comment #8)
> Go to digiKam setup/metadata and turn on "Update file timestamp when
> metadata is saved" option to see if it's fix the problem (it must normaly)

No, turning on this option has no effect !! (may be is it the same bug as bug #327707 ? I have still digikam 3.5).
Comment 10 Frank Reininghaus 2014-01-06 19:53:47 UTC
(In reply to comment #9)
> I disagree with you: I use digikam to rotate my picture precisely because it
> does not update the file's modification. This is so useful when sorting
> files in dolphin !

As I said earlier, I see that this behavior can be useful in some situations. But still, the thumbnailing code has no chance to see that the "old" preview image is outdated then - I hope that you don't disagree with that ;-)

But I don't want to argue about this issue. It's not a Dolphin issue anyway because the code that generates the previews and that is responsible for this is, to my knowledge, part of kdelibs.
Comment 11 Nicofo 2014-01-08 20:39:47 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > I disagree with you: I use digikam to rotate my picture precisely because it
> > does not update the file's modification. This is so useful when sorting
> > files in dolphin !
> 
> As I said earlier, I see that this behavior can be useful in some
> situations. But still, the thumbnailing code has no chance to see that the
> "old" preview image is outdated then - I hope that you don't disagree with
> that ;-)
It's OK, I just disagreed when you said it's a digikam bug ; for the rest I'm totally with you ;-)


Gilles: is it normal the option 'Update file timestamp when metadata is saved' has no effect ?  (see my comment #9 ) ?
Comment 12 caulier.gilles 2014-01-09 07:24:42 UTC
No it's abnormal. In fact currently this settings is only shared with kipi-plugins and used by kipi tools.
Comment 13 caulier.gilles 2014-01-09 08:38:28 UTC
Which king of image you want to rotate by digiKam ? JPEG , PNG, TIFF ?

Typically, with JPEG image, file modification time is always restored in source code...

Gilles Caulier
Comment 14 caulier.gilles 2014-01-09 13:20:37 UTC
Git commit faf186e55fdaeba7f0ecbdfb64ba62fd1783ff29 by Gilles Caulier.
Committed on 09/01/2014 at 13:15.
Pushed by cgilles into branch 'master'.

handle update file timestamp option from Setup/Metadata when file are changed outside metadata, as transformation through icon-view (JPEG files) or when
files are overwritten from Image Editor. BQM already manage this option properly. Import tool is not affected by this settings (as import or export file always preserve file timestamps)
Toogle on option from Setup/Metadata config pannel to on, to prevent all dysfunctions with extra application which use file timestamps to detect automatically file modifications.
FIXED-IN: 4.0.0

M  +5    -5    libs/dmetadata/metadatasettingscontainer.cpp
M  +1    -1    libs/dmetadata/metadatasettingscontainer.h
M  +25   -15   libs/jpegutils/jpegutils.cpp
M  +1    -1    libs/jpegutils/jpegutils.h
M  +19   -3    utilities/imageeditor/editor/editorwindow.cpp
M  +15   -12   utilities/importui/backend/umscamera.cpp
M  +4    -2    utilities/setup/setupmetadata.cpp

http://commits.kde.org/digikam/faf186e55fdaeba7f0ecbdfb64ba62fd1783ff29
Comment 15 caulier.gilles 2014-01-09 13:22:39 UTC
See my previous commit please.

Also, create a new report about thumbnailing code in KIO in case of file time-stamp is not updated when file are modified...

Gilles Caulier
Comment 16 Nicofo 2014-01-09 19:23:02 UTC
Thank you Gilles for your fast reactivity.
I cloned this bug for the KIO part: bug 329773

Gilles -> I have had a look at your last commit for digikam: there is a spelling mistake in:
setupmetadata.cpp, line 277:
" ... when files are changes ... "  ->
" ... when files are changed ... "
Comment 17 caulier.gilles 2014-01-09 21:28:15 UTC
Git commit bf4d66e00a1f786331e2a88636019436f63d88de by Gilles Caulier.
Committed on 09/01/2014 at 21:27.
Pushed by cgilles into branch 'master'.

fix typo

M  +1    -1    utilities/setup/setupmetadata.cpp

http://commits.kde.org/digikam/bf4d66e00a1f786331e2a88636019436f63d88de