Bug 447233 - Incorrect display of album thumbnails
Summary: Incorrect display of album thumbnails
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Thumbs-Album (show other bugs)
Version: 7.4.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-19 14:48 UTC by Peter
Modified: 2021-12-23 06:26 UTC (History)
1 user (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 Peter 2021-12-19 14:48:19 UTC
SUMMARY
Environment: Linux Mint 20.2 (64bit); Windows 10 (64bit); DigiKam 7.4 and earlier (6.x; 7.x version)
Database elements: 35823

Digikam displays thumbnails incorrectly in some cases, but unfortunately I can’t link it to any event, why happening this.
I attached it to the ticket a database dump file and an (empty) SQlite thumbnails file, in this the error is reproduce.

What happen?
After 15849 element the displayed thumbnail elements slide on top of each other, and after 31320 elements empty albums are displayed.

Places where there are problems:
15849 beetween 15891 elements
17488 beetween 1511 elements
17528 beetween 17529 elements
17603 beetween 17606 elements
17488 beetween 17511 elements
17528 beetween 17529 elements
19375 beetween 19456 elements
19464 beetween 19505 elements
21485 beetween 21486 elements
22245 beetween 22246 elements
25014 beetween 25015 elements
25310 beetween 25311 elements
25952 beetween 25971 elements
26037 beetween 26038 elements
26091 beetween 26098 elements
26110 beetween 26156 elements
26289 beetween 26321 elements
etc.
and after 31320 only empty albums

STEPS TO REPRODUCE
1. Environment preparation:
Use the attached database files.

Database settings in digikam:
Core DB name: digikamdb
Thumbs DB folder: attached but empty SQlite database
Face DB name: digikamface
Similarity DB name: digikamsimilar

Digikam settings:
View -- Sort Albums: By Folder
View -- Sort Items: By Name
View -- Item Sort Order: Ascending
View -- Separate Items: By Album
View -- Item Separation Order: Ascending
View -- Include Tag Sub-Tree

2. 
-- Click the parent album (ADATBANK_01)
-- Thumbnails are loaded (only white document icons). Database contain 35823 elements.
-- Scroll to 15849 element and watch what happens (thumbnail elements slide on top of each other).
-- Scroll to the locations specified above and watch what happens
-- Find the 17528 element (in the Album only displayed 1 element). Click left button this item and chose Go To -- Album: All items in the album are displayed.


SOFTWARE/OS VERSIONS
Windows: Windows 10 (64 bit)
Linux/KDE Plasma: Linux Mint Cinnamon (64 bit) -- appimage
Comment 1 Peter 2021-12-19 14:50:28 UTC
Example database and an Screenshot in the zip archivum: https://mega.nz/file/EN40xCAC#pb0oZO-ebqBuZV84eNwh40Um_fImolLYVIbvb50kAQQ
Comment 2 Peter 2021-12-19 15:01:23 UTC
Sorry, an important info missed:
"I attached it to the ticket a database dump file and..."
Correctly:
I attached it to the ticket a MYSQL database dump file and...
Comment 3 Maik Qualmann 2021-12-19 15:13:31 UTC
Well the problem is not unknown. The problem occurs when the item identifier is duplicated in the view model. In principle, we've fixed almost all of the problems over the years. The item identifier is formed from the file path in your settings, I see a very long path, there must be duplicate identifications. I'll have a look.

Maik
Comment 4 Maik Qualmann 2021-12-19 15:25:07 UTC
The SQL dump is very helpful, I can reproduce the problem. The cause is the identifier for the item separation by album, the other as format and month do not have the problem.

Maik
Comment 5 Peter 2021-12-19 15:43:57 UTC
> I see a very long path

Yes, the girls in the office used very long file path in the past. This is a difficult legacy. :-(
Comment 6 Maik Qualmann 2021-12-19 19:30:07 UTC
Ok, you have another problem. In your collection you have album paths that only differ in upper / lower case, that is currently not possible with MySQL, see also Bug 414344.

Change the following album names:

/Dokumentumok/Pályázatok/LEADER/tuskevar  (tuskevar exists also in upper case)

/_BACKUP_/20190928_6_12_duplikatum/X/Dokumentumok/Pályázatok/Pályázatok/ÚJ LEADERES PÁLYÁZATOK/Jeles napok a Szentek társaságában/DOKUMENTUMOK/dokumentáció/2013.10.18 - Növények a Bibliából - Kertbarátkör előadás/fotódokumentáció

/_BACKUP_/20191001_4_5_duplikatum/X/Dokumentumok/Pályázatok/2016/Alapítvány/Norvég Alap/Loli Zumi/Szakmai előrehaladási jelentés/3. Szakmai előrehaladási jelentés Loli Zumi/Alátámasztó dokumentumok/Szakmai tevékenység megvalósításába bevont közreműködők

Maik
Comment 7 Peter 2021-12-20 05:26:01 UTC
(In reply to Maik Qualmann from comment #6)
> Ok, you have another problem. In your collection you have album paths that
> only differ in upper / lower case, that is currently not possible with
> MySQL, see also Bug 414344.
> 
> Change the following album names:
> 
> /Dokumentumok/Pályázatok/LEADER/tuskevar  (tuskevar exists also in upper
> case)
> 
> /_BACKUP_/20190928_6_12_duplikatum/X/Dokumentumok/Pályázatok/Pályázatok/ÚJ
> LEADERES PÁLYÁZATOK/Jeles napok a Szentek
> társaságában/DOKUMENTUMOK/dokumentáció/2013.10.18 - Növények a Bibliából -
> Kertbarátkör előadás/fotódokumentáció
> 
> /_BACKUP_/20191001_4_5_duplikatum/X/Dokumentumok/Pályázatok/2016/Alapítvány/
> Norvég Alap/Loli Zumi/Szakmai előrehaladási jelentés/3. Szakmai
> előrehaladási jelentés Loli Zumi/Alátámasztó dokumentumok/Szakmai
> tevékenység megvalósításába bevont közreműködők
> 
> Maik

Long filenames and exotic characters in the names. I knew they were going to cause a problem now or later... I will change the path and filenames.
Thank You Maik.
Regards
Peter
Comment 8 Maik Qualmann 2021-12-20 06:48:42 UTC
Since the problem occurs more often in bug 414344, I plan to convert the columns Albums:relativePath and Images:name in MySQL as collate utf8-bin. Then album paths and file names can only differ in upper / lower case even under MySQL.

Maik
Comment 10 Maik Qualmann 2021-12-20 14:50:51 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 445948
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
Comment 11 Peter 2021-12-22 17:26:30 UTC
(In reply to Maik Qualmann from comment #10)
> 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 445948
> 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

This excellent news! Thanks Maik!
In this case, do I need to rebuild the database? Or, what should I do?
Comment 12 Maik Qualmann 2021-12-22 20:53:08 UTC
A database update is then carried out automatically when digiKam starts. The start scan for new items will then find additional folders and possibly images that previously only differed in upper / lower case. The problem with the view should then be resolved.

With this commit we have already made sure that the search for album path and item name is still not case sensitive.

https://invent.kde.org/graphics/digikam/-/commit/7c06a091903978bd698067a5b93875f36653a913

Maik
Comment 13 Peter 2021-12-23 06:26:11 UTC
Ok! Grateful thanks Maik!