Created attachment 165089 [details] ZIP file containing screenshots and an example album. SUMMARY *** If you import metadata for an image using an XMP sidecar file, and the sidecar contains a tag that is already in the tag database, but the CaSe doesn't match what is in the database, then the tag is ignored. Attached is a ZIP file with an example image and sidecar as well as some screenshots of the issue. The Tag "girl" is not imported and cannot be seen in Digikam. However in the tag manager the tag "GIRL" already exists. If I change the XMP sidecar tag to "GIRL" then it appears in Digikam. *** STEPS TO REPRODUCE 1. Add the tag "GIRL" to the database. 2. Enable Settings > Metadata > Read from sidecar files 2. Download the attached ZIP, extract it, and add the Album folder as an Album. OBSERVED RESULT The "girl" tag isn't imported. If you modify the sidecar file and change it to "GIRL" then re-read the metadata (Tools > Maintenance > Sync Metadata and Database > Sync Direction "From image metadata to database") it will appear in the list. EXPECTED RESULT One of them should be added, preferably whichever tag already exists in the database should be added. SOFTWARE/OS VERSIONS Linux/Ubuntu: 22.04.3 KDE Frameworks Version: 5.110.0 Qt Version: 5.15.11 (built against 5.15.11) ADDITIONAL INFORMATION I'm using a MySQL database.
A MySQL database is not case-sensitive. Otherwise we would have to use a binary collator, but that brings other problems. Using SQLite would be an alternative if case-sensitive is important to you. Maik
*** This bug has been marked as a duplicate of bug 464853 ***
(In reply to Maik Qualmann from comment #1) > A MySQL database is not case-sensitive. Otherwise we would have to use a > binary collator, but that brings other problems. Using SQLite would be an > alternative if case-sensitive is important to you. > > Maik Hi Maik, I don't mind if the DB is case-sensitive particularly but the behaviour seems wrong to me: - If an existing tag is in the database, but doesn't match the case of the tag being imported, then the tag is ignored entirely. I would expect it to add the tag but match the case in the database. I noticed while opening Digikam is outputs this error a lot, and one of them matches the tag I'm testing with here, not sure if it's related: > Digikam::AlbumManager::scanTAlbums: Failed to find parent tag for tag "girl" with pid 4460 Also, I noticed that the tag does show up under Properties > Tags > Keywords, but doesn't show up in the thumbnail view or under Captions > Tags
For MySQL, "girl" is the same as "GIRL" or Girl". If you have "girl" in the database and try to create the tag "GIRL", MySQL will give you an error, but SQLite will not. It is normal behavior for MySQL string fields. Only binary storage could solve the problem. Read also https://bugs.kde.org/show_bug.cgi?id=464853#c1 Maik
(In reply to Maik Qualmann from comment #4) > For MySQL, "girl" is the same as "GIRL" or Girl". If you have "girl" in the > database and try to create the tag "GIRL", MySQL will give you an error, but > SQLite will not. > > It is normal behavior for MySQL string fields. Only binary storage could > solve the problem. > > Read also https://bugs.kde.org/show_bug.cgi?id=464853#c1 > > Maik Hi Maik, but even if we can't add the new tag to the database, can we associate the existing tag with the image still somehow?
Git commit c4fa9a3b631e7684722d70780c9c2df27a9e026c by Maik Qualmann. Committed on 21/01/2024 at 17:30. Pushed by mqualmann into branch 'master'. handle case sensitive tags better under MySQL Related: bug 464853 FIXED-IN: 8.3.0 M +1 -1 NEWS M +1 -1 core/data/database/dbconfig.xml.cmake.in M +18 -0 core/libs/database/coredb/coredb.cpp https://invent.kde.org/graphics/digikam/-/commit/c4fa9a3b631e7684722d70780c9c2df27a9e026c
(In reply to Maik Qualmann from comment #6) > Git commit c4fa9a3b631e7684722d70780c9c2df27a9e026c by Maik Qualmann. > Committed on 21/01/2024 at 17:30. > Pushed by mqualmann into branch 'master'. > > handle case sensitive tags better under MySQL > Related: bug 464853 > FIXED-IN: 8.3.0 > > M +1 -1 NEWS > M +1 -1 core/data/database/dbconfig.xml.cmake.in > M +18 -0 core/libs/database/coredb/coredb.cpp > > https://invent.kde.org/graphics/digikam/-/commit/ > c4fa9a3b631e7684722d70780c9c2df27a9e026c Thank you Maik, it's much appreciated :)