Bug 391312

Summary: Rename with time template can add colons (:) forbidden character in Windows 10
Product: [Applications] digikam Reporter: Paul A. <pschroeter>
Component: AdvancedRename-fileAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: freddie, metzpinguin, vilkmail
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.9.0
Sentry Crash Report:

Description Paul A. 2018-03-02 20:15:10 UTC
I was using  [date:"h:mm A"] to batch rename some files. I thought the new names looked good in the preview so I hit OK and the files promptly disappeared. I used my file browser to look in the folder and all the photos were now 0 bytes in sized and no longer JPGs. I eventually realized the date template was able to add a COLON to the filenames and realized they are forbidden characters in the Windows file system. 
I know I should remember more forbidden characters, but I think the program should not let me and especially catch it in the preview.

I once renamed a folder and somehow added a space to the end of the folder name that Windows 10 forbids for filenames that I could not open that I had to delete from the Run prompt. I also think folder names that end in a ")" cause problems. They show in the tree but show as empty in thumbnails until I rename them back to the old name.
Comment 1 Maik Qualmann 2018-03-03 19:02:22 UTC
Git commit 628152e30af7f44c06718d3240ea1f7c439e5c2b by Maik Qualmann.
Committed on 03/03/2018 at 19:01.
Pushed by mqualmann into branch 'development/6.0.0'.

replace or block colon in renaming files and album title on Windows

M  +6    -0    libs/album/albumpropsedit.cpp
M  +9    -1    utilities/advancedrename/advancedrenamemanager.cpp

https://commits.kde.org/digikam/628152e30af7f44c06718d3240ea1f7c439e5c2b
Comment 2 Maik Qualmann 2018-03-03 19:05:43 UTC
Git commit 963afab9a746647854550e43d08de75f433da75e by Maik Qualmann.
Committed on 03/03/2018 at 19:04.
Pushed by mqualmann into branch 'master'.

replace or block colon in renaming files and album title on Windows
FIXED-IN: 5.9.0

M  +2    -1    NEWS
M  +6    -0    libs/album/albumpropsedit.cpp
M  +9    -1    utilities/advancedrename/advancedrenamemanager.cpp

https://commits.kde.org/digikam/963afab9a746647854550e43d08de75f433da75e
Comment 3 Maik Qualmann 2018-03-03 19:07:13 UTC
Note: I could not reproduce a problem with spaces at the beginning or end of file names or with parentheses.

Maik
Comment 4 Paul A. 2018-03-03 19:34:25 UTC
(In reply to Maik Qualmann from comment #3)
> Note: I could not reproduce a problem with spaces at the beginning or end of
> file names or with parentheses.
> 
> Maik

I think I may have caused the album/folder problem using either "Renameā€¦ > Rename Album" or "Properties" in the folder tree. I have been only been using digiKam for about a week and having fun going though thousands of my photos and albums/folder and organizing them with tags and photo/album renaming. What I'm trying to say is I was going through my files at a very fast pace, and in some circumstances I would cut and paste (maybe something with a space at the end) to the end of a name or type very fast and hit OK quickly to change a name. I think it only happened twice.

I love digiKam and have settled on using it, even though I tried a couple paid programs out. I think in general any function that can change the name of a photo or album needs to do a better job screening for Windows (10 and below) forbidden file characters. I think it's because of the libraries the program is built with. For now I have just been trying to be more careful renaming files.

I thought the colon problem really needed to be reported right away because it destroyed those files. It only happened once, and since I knew I was experimenting with rename still had the originals on the camera.
Comment 5 Freddie Witherden 2018-03-20 11:20:36 UTC
This problem is not limited to Windows.  One can also reproduce it on Linux by placing the album onto a FAT32/exFAT file system, which share similar restrictions.  A more generic solution may therefore be in order.
Comment 6 Maik Qualmann 2018-04-15 08:12:44 UTC
Git commit 2d8d7be73d4b81ed298cd21edae2a7350128fb48 by Maik Qualmann.
Committed on 15/04/2018 at 08:10.
Pushed by mqualmann into branch 'master'.

we always replace the colon to avoid problems with Windows file systems
Related: bug 329438
FIXED-IN: 6.0.0

M  +2    -1    NEWS
M  +0    -6    core/libs/album/albumpropsedit.cpp
M  +1    -5    core/utilities/advancedrename/advancedrenamemanager.cpp

https://commits.kde.org/digikam/2d8d7be73d4b81ed298cd21edae2a7350128fb48
Comment 7 vilkmail 2018-06-23 13:53:44 UTC
*** Bug 395788 has been marked as a duplicate of this bug. ***
Comment 8 Maik Qualmann 2018-06-24 11:35:14 UTC
Git commit 33234dc80d3162823e569b0f0bf67d96321e0dc9 by Maik Qualmann.
Committed on 24/06/2018 at 11:33.
Pushed by mqualmann into branch 'master'.

replace invalid characters under a Windows file system when renaming
Related: bug 395790
FIXED-IN: 6.0.0

M  +2    -1    NEWS
M  +11   -1    core/utilities/advancedrename/advancedrenamemanager.cpp

https://commits.kde.org/digikam/33234dc80d3162823e569b0f0bf67d96321e0dc9