ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: Lenni2 on July 20, 2017, 04:33:08 PM

Title: Formatting parameter %%C broken in ExifTool 10.59 for Windows?
Post by: Lenni2 on July 20, 2017, 04:33:08 PM
Hi there,

many years ago you implemented a parameter %%C which helps renaming photos to filenames with sequential numbers. This has been working reliably in my Windows batch script which does a lot of automated processing of my photo files. However this doesn't work anymore with ExifTool 10.59 - instead of incrementing the number it get stuck at "001". I downloaded some older versions and it seems that the bug has been introduced with exactly this version, so I reverted to v10.58 and everything started working again.

The essential lines of code are:

rem Put the date/time into the filename
exiftool -d %%Y.%%m.%%d_%%H%%M%%S.%%%%e "-filename<createdate" *.jpg >nul

rem Write a sorted list of the filenames to a temporary file
dir /b /on /a-d *.jpg >%TEMPFILE%

rem Use this temp file to rename the files a second time, putting a sequential 3-digit number in front of the filename
rem This seems to be broken in v10.59, the 3-digit number is always 001 instead of being incremented.
exiftool -filename=%%.3nC_%%-.2f.%%e -@ %TEMPFILE% >nul

(Windows 8.1, 64 Bit)

Are you able to reproduce this behaviour? Thank you.

Lenni
Title: Re: Formatting parameter %%C broken in ExifTool 10.59 for Windows?
Post by: Phil Harvey on July 20, 2017, 09:56:52 PM
Hi Lenni,

The original implementation of %C didn't work the way I had intended.  There was also a bug in the implementation that could cause a hang.

I'll look into this and post back when I get a chance.

- Phil
Title: Re: Formatting parameter %%C broken in ExifTool 10.59 for Windows?
Post by: Phil Harvey on July 21, 2017, 08:13:13 AM
Thanks for this report.

I have just released ExifTool 10.60 which should fix this problem.

- Phil
Title: Re: Formatting parameter %%C broken in ExifTool 10.59 for Windows?
Post by: Lenni2 on July 21, 2017, 10:46:45 AM
Hi Phil,

Wow, what a fast fix! I just tested it and my batch works again with v10.60 (as is has done with all versions up to v10.58). Thank you for this great tool!

Lenni