ExifTool hangs (caused by loop?) when renaming files using %2.4C and file exists

Started by FrankB, September 04, 2024, 01:33:25 PM

Previous topic - Next topic

FrankB

Environment
Exiftool: 12.96
Windows 10 Pro

Steps to reproduce:
- Create a directory with 2 JPG's (File1.jpg and File2.jpg) with the same date in Exif:DateTimeOriginal.
- Execute this command to rename File1.jpg

exiftool -v0 -overwrite_original "-filename<${Exif:DateTimeOriginal} RenameTest%2.4C.%e" -d %Y-%m-%d File1.jpg

This will rename the JPG to <2024-09-04 RenameTest0002.jpg> (Or whatever date was in Exif:DateTimeOriginal)

- Execute the same command to rename File2.jpg

exiftool -v0 -overwrite_original "-filename<${Exif:DateTimeOriginal} RenameTest%2.4C.%e" -d %Y-%m-%d File2.jpg

This will cause ExifTool to hang. I think because it might be looping to find an unused filename.

Furter testing makes me believe that the problem occurs when the first file sequence nbr that ExifTool should try exists, but only when using %C (Uppercase), %c (lowercase) works fine.

Frank

StarGeek

I was able to narrow this down to version 12.57 (works) and 12.58 (doesn't).

From the version history
QuoteFixed issue where the %C filename format code would increment the count on an output filename collision, but it is supposed to count the input files

Phil is away for a couple of weeks, so this will have to wait until he returns.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

FrankB

Quote from: StarGeek on September 04, 2024, 02:15:20 PMI was able to narrow this down to version 12.57 (works) and 12.58 (doesn't).

Thanks.

Quote from: StarGeek on September 04, 2024, 02:15:20 PMPhil is away for a couple of weeks, so this will have to wait until he returns.

Forgot to mention: No hurry.