Bug 510364 - Batch renaming - Same date format in the file name for all images
Summary: Batch renaming - Same date format in the file name for all images
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: AdvancedRename-file (other bugs)
Version First Reported In: 8.8.0
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-07 21:31 UTC by sourcemaker
Modified: 2025-12-25 10:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In: 9.0.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sourcemaker 2025-10-07 21:31:09 UTC
I have thousands of images, but they use different date formats in their file names.

IMG_yyyyMMdd_hhmmss
IMG_yyyyMMdd_hhmmss_zzz
yyyyMMdd_hhmmss
yyyy_COUNTER

Therefore, I am looking for a way to ensure that all images use the same date format in the file name.

When I use [meta:Exif.Photo.DateTimeOriginal], I cannot change the date format.
The [date] option allows me to change it, but uses the file system's modification date as a fallback if no Exif metadata is available. This makes it unusable.

Feature request:
If possible, rename all images using the option [meta:Exif.Photo.DateTimeOriginal] to IMG_yyyyMMdd_hhmmss_zzz. Otherwise, keep the file name unchanged.
Comment 1 Maik Qualmann 2025-10-26 09:12:29 UTC
Git commit e32c55ba1e255f035fcdcf3a548e71d5f17eb3e0 by Maik Qualmann.
Committed on 26/10/2025 at 09:11.
Pushed by mqualmann into branch 'master'.

add modifier to detect and format a date
The modifier can detect metadata date or
also date in a file name and format it.
FIXED-IN: 8.9.0

M  +1    -1    NEWS
M  +1    -0    core/utilities/advancedrename/CMakeLists.txt
M  +3    -1    core/utilities/advancedrename/advancedrenameinput.cpp
M  +2    -0    core/utilities/advancedrename/common/parser.cpp
A  +79   -0    core/utilities/advancedrename/parser/modifiers/dateformatmodifier.cpp     [License: GPL(v2.0+)]
A  +44   -0    core/utilities/advancedrename/parser/modifiers/dateformatmodifier.h     [License: GPL(v2.0+)]
M  +6    -13   core/utilities/advancedrename/parser/options/dateoption.cpp

https://invent.kde.org/graphics/digikam/-/commit/e32c55ba1e255f035fcdcf3a548e71d5f17eb3e0
Comment 2 Maik Qualmann 2025-10-26 11:57:32 UTC
Here's an example of your possible renaming string:

IMG_[meta:Exif.Photo.DateTimeOriginal]{dateformat:yyyyMMdd_hhmmss_zzz}

or:

IMG_[file]{dateformat:yyyyMMdd_hhmmss_zzz}

Maik