Too many duplicates - need to add millisecond

Started by okeetd, September 03, 2023, 10:54:12 AM

Previous topic - Next topic

okeetd

I use Exiftool to rename all iphone pics with HhMmSs so that I avoid storing duplicates on the computer. I am getting more and more duplicates as iphone now is taking 2-3 pics per second if you aren't careful. I think it is time to add Milliseconds. I am not all that great with scripts so I could use help to convert the below script to include Ms after the Ss below? Any help would be appreciated.

exiftool -ext jpg "-FileName<DateTimeOriginal" -d "%Y-%m-%d %Hh%Mm%Ss.%%e" "F:\Import Folder"

StarGeek

Because the subseconds are held in a different tag from the main date/time, things have to be moved around a bit

Try this
exiftool -ext jpg "-Filename<$DateTimeOriginal.$SubSecTimeOriginal.%e" -d "%Y-%m-%d %Hh%Mm%Ss" "F:\Import Folder"
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

okeetd

Thanks StarGeek - its minor, but can I simply remove the period between date/time original and subsectime or is that critical to the script? It seems to work, but while the script is running I can see it repeating bad format for maker notes?

StarGeek

Yes, you can remove the dot.  That was just there for formatting.  The only thing to watch for is if you decide to add regular letters/numbers after $SubSecTimeOriginal.  In that case, you would need to add braces

For example
exiftool -ext jpg "-Filename<$DateTimeOriginal${SubSecTimeOriginal}subsec.%e" -d "%Y-%m-%d %Hh%Mm%Ss" "F:\Import Folder"

The specific rule is that braces "must be used if subsequent text begins with an alphanumeric character, hyphen, underline, colon or number sign"
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype