Bug 355590 - Do not re-use existing thumbnail for files/images for which a real thumbnail can't be generated
Summary: Do not re-use existing thumbnail for files/images for which a real thumbnail ...
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 5.0.0
Platform: Fedora RPMs Linux
: NOR major
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-19 13:58 UTC by Éric Brunet
Modified: 2019-05-24 15:44 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.08.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Éric Brunet 2015-11-19 13:58:11 UTC
When gwenview fails to create a thumbnail, it reuses the last displayed thumbnail.

Reproducible: Always

Steps to Reproduce:
1. Create a directory, put in it an image called a.jpg
2. Create an empty file called b.jpg  (for instance: touch b.jpg )
3. Launch gwenview on the directory

Actual Results:  
gwenview tries to create a thumbnail for b.jpg, but it is impossible as it is not a jpg file. However, gwenview does display a thumbnail for b.jpg: it reuses the one created for a.jpg. Then, the user sees twice the same picture with different names, which is confusing. The user might delete a.jpg believing there is a copy in b.jpg!

Expected Results:  
b.jpg should not be displayed by gwenview, or should be displayed without thumbnail, or with a "there was an error" thumbnail.

I have seen this bug after upgrading from fedora 21 to fedora 23, on a directory containing both .jpg and .tiff files. gwenview was unable to make thumbnails for the .tiff files because package qt5-qtimageformats was not installed (that was not obvious and took me some time to find out!) and so, silently, it reused for each tiff the latest successfully generated thumbnail (for a .jpg file). There was a moment of panic: were some files overwritten ?

I leave the severity as normal, although it could arguably be marked as critical, because this bug might induce the user to remove some files, believing there is a copy, and thus lose some data.
Comment 1 Nate Graham 2017-11-09 19:40:12 UTC
Agreed. Hopefully this is an easy fix.
Comment 2 Nate Graham 2019-05-24 15:44:05 UTC
Git commit f5b3f0d91c044aa2ba7bf521ccbad062cbcbcd4d by Nate Graham, on behalf of Tom Moebert.
Committed on 24/05/2019 at 15:43.
Pushed by ngraham into branch 'master'.

Do not re-use previously generated thumbnails in case of error

Summary:
If thumbnail generation had failed for a certain image, the thumbnail from the previous successful run would have been mistakenly used.

Reviewers: #gwenview, ngraham

Reviewed By: #gwenview, ngraham

Subscribers: ngraham, #gwenview

Tags: #gwenview

Differential Revision: https://phabricator.kde.org/D21337

M  +2    -0    lib/thumbnailprovider/thumbnailgenerator.cpp

https://commits.kde.org/gwenview/f5b3f0d91c044aa2ba7bf521ccbad062cbcbcd4d