Rename all files to BURST format

Started by lmiol, October 17, 2022, 03:04:38 AM

Previous topic - Next topic

Phil Harvey

So you are running from inside a .bat file?  This was important information.

In your initial examples all burst images had the same date/time.  Now you are saying they are different and you want to use the timestamp from the first one?  How is ExifTool supposed to tell which images should be part of the burst?  It seems as if we are back to the beginning here, and I don't understand exactly what you are trying to do.  I could take a guess, and give you another command that I think might work, but the way things have been going I don't think that would help.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lmiol

#16
I'm sorry, it seems I misled you.
I selected only one square in the image at section "From this" and thought it was enough
Quote from: lmiol on October 17, 2022, 07:32:33 AM

Now i see, i should did it more specific, like this:

Not each to each, but one to each

Quote from: Phil Harvey on October 17, 2022, 03:25:33 PMSo you are running from inside a .bat file?
i am execute 1.bat

Phil Harvey

OK,  The only way to do this is to take copy the date/time from the first file, so in your .bat file the command would be:

exiftool -tagsfromfile IMG_20221017_194216846.jpg "-filename<IMG_%%nC_BURST${CreateDate}000.%%e" -d %%Y%%m%%d%%H%%M%%S -fileorder filename *.jpg

Here I have also added the "000" as in your example after the date/time.  Also, I have added -fileorder filename to be sure the files are processed in the correct order because sometimes the directory entries aren't sorted.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lmiol

Quote from: Phil Harvey on October 18, 2022, 03:18:25 PMOK,  The only way to do this is to take copy the date/time from the first file, so in your .bat file the command would be:

exiftool -tagsfromfile IMG_20221017_194216846.jpg "-filename<IMG_%%nC_BURST${CreateDate}000.%%e" -d %%Y%%m%%d%%H%%M%%S -fileorder filename *.jpg

Here I have also added the "000" as in your example after the date/time.  Also, I have added -fileorder filename to be sure the files are processed in the correct order because sometimes the directory entries aren't sorted.

Thank you, Phil. It works brilliant!
But it is possible to determine first file of sort for -tagsfromfile automatically?
I mean do not specify manually IMG_20221017_194216846.jpg

Phil Harvey

ExifTool can't help you to determine the name of the first file.  There is probably a way to do this using batch-file commands, but I can't help with that.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lmiol

Quote from: Phil Harvey on October 18, 2022, 07:56:39 PMExifTool can't help you to determine the name of the first file.  There is probably a way to do this using batch-file commands
Got it. Thank you for your time and useful help, Phil!

lmiol

#21
Quote from: Phil Harvey on October 18, 2022, 03:18:25 PMexiftool -tagsfromfile IMG_20221017_194216846.jpg "-filename<IMG_%%nC_BURST${CreateDate}000.%%e" -d %%Y%%m%%d%%H%%M%%S -fileorder filename *.jpg

And what if names of files are
PXL_20230101_122059555.jpg
PXL_20230101_122101444.NIGHT.jpg
PXL_20230101_122102221.PORTRAIT.jpg

and how to rename from -tagsfromfile PXL_20230101_122059555.jpg
into this:
PXL_20230101_122059555.BURST-1.jpg
PXL_20230101_122059555.NIGHT-2.jpg
PXL_20230101_122059555.PORTRAIT-3.jpg
?

(because this is another BURST format for Google Photo, for PXL_ prefix files, which i discoved recently)


UPDATE:
After exiftool rename It is seems it is need to use regex to find [0123456789]+-
and then put BURST word
I wil try to do it myself and back later