Bug 424441 - detect defective pictures
Summary: detect defective pictures
Status: REPORTED
Alias: None
Product: digikam
Classification: Applications
Component: Maintenance-Quality (show other bugs)
Version: 7.1.0
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-19 22:11 UTC by Daniel
Modified: 2023-12-01 11:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2020-07-19 22:11:40 UTC
SUMMARY
It would be nice if digikam could show a list of possible defective pictures. Some defective pictures can be identified using the logging output of digikam. A picture is defective, if it has size 0byte, a hard edge in it or color defects (missing data). This would be nice because it would show early signs of a failing hard disk (and make the user apparent that they should always have a backup).

ADDITIONAL INFORMATION
I am not sure how such defective pictures can be detected easily, but I have noticed that I have a bunch of them in my collection AFTER initial import into digikam (due to possible hard disk failure, corruption when copying, force-shutting digikam, I don't know)
Comment 1 fch22 2023-05-15 16:33:37 UTC
I found an option using exiv2 under windows that can highligth corrupted image, if it can help

>bin\exiv2.exe -pp -q P2280067_DxO-corrupted.jpg
Exiv2 exception in print action for file P2280067_DxO-corrupted.jpg:
P2280067_DxO-corrupted.jpg: The file contains data of an unknown image type

>bin\exiv2.exe -pp -q P2280067_DxO.jpg
Preview 1: image/jpeg, 317x237 pixels, 17356 bytes

>bin\exiv2.exe -pp -q .\P2280067.ORF
Preview 1: image/jpeg, 160x120 pixels, 9080 bytes
Preview 2: image/jpeg, 3200x2400 pixels, 1060974 bytes

I think that could be a good solution to find corrupted jpeg. Based on this I have some thought
- as exiv2 is native with Digikam, I guess such error could be visible? Is there some "debug level" or some logs somewhere that could report such errors ?
- I'm not expert on coding so don't know how to translate such command to a recursive search on a set of folders?
- seems to apply to raw also , but I don't have corrupted raw to perform the test
Comment 2 caulier.gilles 2023-12-01 11:45:16 UTC
Maik,

A possible way is to see if the image data is null or not. See my comment here :

https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/imgqsort/imagequalityparser.cpp?ref_type=heads#L63

Gilles
Comment 3 caulier.gilles 2023-12-01 11:46:03 UTC
Daniel,

The Exiv2 exception is also generated if the file format is not recognized by the library. It cannot be used for this task.

Gilles Caulier