Bug 503387 - Import creates bad directories and file names and confusing XMP handling
Summary: Import creates bad directories and file names and confusing XMP handling
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: AdvancedRename-Import (other bugs)
Version First Reported In: 8.6.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-26 13:27 UTC by HubMiner
Modified: 2025-04-26 21:39 UTC (History)
2 users (show)

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


Attachments
Import - Settings (23.70 KB, image/png)
2025-04-26 15:50 UTC, HubMiner
Details
Folders created by the import. (4.06 KB, image/png)
2025-04-26 15:53 UTC, HubMiner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description HubMiner 2025-04-26 13:27:42 UTC
SUMMARY
The goal was to create date based directires and files.
Import process created the directories, 
album view created folders with unexpected named.
Image files are in the right place.
but with names derived from full path.
Files are not accessible in DK.

STEPS TO REPRODUCE
1. Import - Add Images
2. Chosing an input/import folder
3. Images are shown (8 files)
4. Selecting a single image
5. right: Settings
6. Scripting, DNG, On The Fly: nothing
7. Auto Creation of Albums: Date Based sub-albums, date format: yyyy\yyyy-MM-dd
8. File Renaming Options, customize, [date:"yyyyMMdd_hhmmss"]{unique}

EXPECTED RESULT
1. JPG file is moved to: {MY TOP}\2021\2021-06-12\20210612_122413.jpg
2. JPG is renamed to 20210612_122413.jpg
3. XMP file handled the same.
4. JPG is visible in expected album in DK

OBSERVED RESULT
1. JPG file was correctly moved to: {MY TOP}\2021\2021-06-12\
2. JPG file was incorrectly named based on full file path.
3. Input XMP was not copied and was regenerated on the fly after a few seconds.  This will mislead users unless they check XMP contents.
4. The copied JPG was not accessible in DK, see attached screenshot.

ADDITIONAL INFORMATION
My workaround: change folder pattern: \ -> /
Comment 1 HubMiner 2025-04-26 15:50:49 UTC
Created attachment 180688 [details]
Import - Settings
Comment 2 HubMiner 2025-04-26 15:53:12 UTC
Created attachment 180689 [details]
Folders created by the import.

This shows folders created by the import. The first 3 dated folders contaned filed, but DK lists the folders had 0 fiiles.  Refreshing folders didn't help (probbaly a minor DB coccuption).

To recover, I deleted the folders and reran the import, using "/" in the folder pattern.
Comment 3 Maik Qualmann 2025-04-26 19:04:57 UTC
We're a *nix program and internally use "/" as the directory separator. And yes, Windows also understands "/" as a directory in its API, just not in the CMD.

Maik
Comment 4 Maik Qualmann 2025-04-26 19:22:19 UTC
Git commit 83d5cd8245d8aecd476e5275b8c352a67338f7c2 by Maik Qualmann.
Committed on 26/04/2025 at 19:21.
Pushed by mqualmann into branch 'master'.

replace backslash with slash on Windows
FIXED-IN: 8.7.0

M  +1    -1    NEWS
M  +10   -1    core/utilities/import/widgets/albumcustomizer.cpp

https://invent.kde.org/graphics/digikam/-/commit/83d5cd8245d8aecd476e5275b8c352a67338f7c2
Comment 5 HubMiner 2025-04-26 21:39:41 UTC
Understood & thanks for the quick fix!