Bug 469310

Summary: digiKam won't import images that have emoji in the filename
Product: [Applications] digikam Reporter: Bravo Baavo <b4yf823ap56y457945ty4w7o>
Component: Database-MysqlAssignee: Digikam Developers <digikam-bugs-null>
Status: REOPENED ---    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version: 8.2.0   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Output log from Digikam

Description Bravo Baavo 2023-05-03 13:23:56 UTC
Created attachment 158652 [details]
Output log from Digikam

SUMMARY
***
When importing a file that includes an emoji, Digikam failed to form the correct SQL syntax and couldn't import the file:
My image was called "107779126_p0 - bookwormđź“–-.png"

See attached log file
***


STEPS TO REPRODUCE
1. Create an image called "107779126_p0 - bookwormđź“–-.png"
2. Try to import it into Digikam when using a MySQL database.

OBSERVED RESULT
No image will be imported, log shows more details.

EXPECTED RESULT
Image should be imported with the emoji filename.

SOFTWARE/OS VERSIONS
Ubuntu: Ubuntu 22.04.2
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.7 (built against 5.15.7)

ADDITIONAL INFORMATION
I'm using a MariaDB database version 10.11.2
Comment 1 Maik Qualmann 2023-05-03 19:48:17 UTC
Git commit 59b33200cb1dbcfa1d2dcb2956f606324ab03201 by Maik Qualmann.
Committed on 03/05/2023 at 19:47.
Pushed by mqualmann into branch 'master'.

perform database update to switch to utf8mb4
for file paths in Core and Thumbs DB
FIXED-IN: 8.1.0

M  +1    -1    NEWS
M  +22   -4    core/data/database/dbconfig.xml.cmake.in
M  +9    -1    core/libs/database/coredb/coredbschemaupdater.cpp
M  +21   -1    core/libs/database/thumbsdb/thumbsdbschemaupdater.cpp
M  +1    -0    core/libs/database/thumbsdb/thumbsdbschemaupdater.h

https://invent.kde.org/graphics/digikam/commit/59b33200cb1dbcfa1d2dcb2956f606324ab03201
Comment 2 Maik Qualmann 2023-05-03 19:58:15 UTC
Another short explanation. By default, UTF8 in MySQL is 3 bytes long (yes, UTF8 is not always UTF8). A 🙂 is already in the address space of 4 bytes.

Maik
Comment 3 Bravo Baavo 2023-05-03 21:33:52 UTC
Amazing thanks :)
Comment 4 Maik Qualmann 2023-05-05 06:13:49 UTC
Git commit 56a9195583a9938a931abcfa7ea67742b9d14ce3 by Maik Qualmann.
Committed on 05/05/2023 at 06:12.
Pushed by mqualmann into branch 'master'.

revert "perform database update to switch to utf8m"
Related: bug 431262

M  +4    -22   core/data/database/dbconfig.xml.cmake.in
M  +1    -9    core/libs/database/coredb/coredbschemaupdater.cpp
M  +1    -20   core/libs/database/thumbsdb/thumbsdbschemaupdater.cpp
M  +0    -1    core/libs/database/thumbsdb/thumbsdbschemaupdater.h

https://invent.kde.org/graphics/digikam/commit/56a9195583a9938a931abcfa7ea67742b9d14ce3
Comment 5 caulier.gilles 2023-10-11 05:07:37 UTC
Bravo,

What's about this file using current 8.2.0 AppImage Linux bundle ? It's
reproducible ?

https://files.kde.org/digikam/

Thanks in advance

Gilles Caulier
Comment 6 Bravo Baavo 2024-01-21 00:43:00 UTC
(In reply to caulier.gilles from comment #5)
> Bravo,
> 
> What's about this file using current 8.2.0 AppImage Linux bundle ? It's
> reproducible ?
> 
> https://files.kde.org/digikam/
> 
> Thanks in advance
> 
> Gilles Caulier

Hi Gilles,
Sorry for taking so long to get back to you, I tested today with 8.2.0 and can confirm the issue is still there.
I think the database change did fix it, but it was reverted because it caused some other problems here https://bugs.kde.org/show_bug.cgi?id=431262#c19

Happy to test any further changes let me know.
Kind regards,
Bravo.