Bug 445948 - dk only shows one file if two files only differ in lower/upper case extension
Summary: dk only shows one file if two files only differ in lower/upper case extension
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Mysql (show other bugs)
Version: 7.3.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-22 23:04 UTC by Kusi
Modified: 2021-12-20 14:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.5.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kusi 2021-11-22 23:04:06 UTC
SUMMARY
Digikam doesn't handle two identical files, one with upper case extension, the other one with lower case extension. In an alternating order, only the images with lower case ext are shown or the images with upper case are shown.

This is an improbable case, however happens when you copy over files from a Windows machine who handles lower/uppercase only halfway. I had around 50 of such files on in my collection.

STEPS TO REPRODUCE
1. add two identical files with the name IMG_001.JPG and IMG_001.jpg
2. Restart digikam: only IMG_001.jpg is visible
3. Restart digikam: only IMG_001.JPG is visible

OBSERVED RESULT
only one of the two images is shown at a time

EXPECTED RESULT
treat both files as different images. Gwenview, for example, shows both IMG_001.jpg and IMG_001.JPG

ADDITIONAL INFORMATION
using external mariadb (mysql)
Comment 1 Maik Qualmann 2021-11-23 05:28:51 UTC

*** This bug has been marked as a duplicate of bug 414344 ***
Comment 2 Maik Qualmann 2021-11-23 07:04:53 UTC
Historically, MySQL is case insensitive. We would have to use utf8-bin as the context so that special characters still work as well. This binary storage of strings also has some disadvantages, for example the search would also be case sensitive, compared to the search in SQLite which is case insensitive. It would be possible to perform a context conversion for the search query, but this is much slower.

Maik
Comment 3 Kusi 2021-11-23 13:25:54 UTC
I see. However, the problem here is that digikam "swallows" the error without notifying the user. You can set a tag to an image, and when you restart digikam, the tags are gone. If you restart again, the tags are here again. The alternating images/hiding of images is not obvious to the user. A warning like: "Digikam cannot handle upper/lower case differences. Please rename the images outside of Digikam" would already be good enough
Comment 5 Maik Qualmann 2021-12-20 14:51:08 UTC
Git commit 56c96d9aadca8a2108c08b09888541e52a0eedea by Maik Qualmann.
Committed on 20/12/2021 at 07:16.
Pushed by mqualmann into branch 'master'.

use COLLATE utf8_bin for album path and image name
Related: bug 414344, bug 435767, bug 447233
FIXED-IN: 7.5.0

M  +4    -4    NEWS
M  +11   -2    core/data/database/dbconfig.xml.cmake.in
M  +9    -1    core/libs/database/coredb/coredbschemaupdater.cpp

https://invent.kde.org/graphics/digikam/commit/56c96d9aadca8a2108c08b09888541e52a0eedea