Generate increasing Time for the AllDates Tag

Started by JanK, December 13, 2011, 03:43:13 PM

Previous topic - Next topic

JanK

I thought it was still in the forum but I can't find it again.

I have several scanned images. These images have no time Tag. I don't know the correct time when the images were taken so I will add a increasing time. All that I know is the date of the pictures. It was 2009:09:14 and the order of the images. So I will give the first image the Date/Time 2009:09:14 12:00:00 and the second image should be 2009:09:14 12:00:01 and so on.

So I have
exiftool '-AllDates=2009:09:14 12:00:00' -overwrite_original DIR
but what do I have to use for increasing the time by one minute from picture to picture.
-Mac OSX Mountain Lion-

Phil Harvey

#1
This thread had a Windows batch file that would do what you want, but I suspect you may want a solution that will work on your Mac.

However, maybe there is a better solution.  If I add a new tag which gives you a sequence number, then you could do this:

exiftool '-allDates+<0:0:$sequence' DIR

Let me think about this.  Does "Sequence" sound right?  Maybe "Index" or "Count" instead?

- Phil

Edit: All of my tag name suggestions have potential conflicts with other extracted tags.  I like this idea, and I'm thinking now that "FileSequence" may be best for the name, so the command would be:

exiftool '-allDates+<0:0:$filesequence' DIR
...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 ($).

JanK

Hi Phil,

That's nice of you that you will add a function for doing that.

I think "filesequence" could occur some conflict in the definition. Your are right "Sequence" or "Count" would be perfect but as you said it bring some conflicts.
All that it should do is generating a Number 1,2,3,4... from picture to picture. When I use this for the time and use the time for my fileorder then it will result in a FILEsequence. But people could use this for other tags which will not influence the file order so for this people it could be a little bit confusing why this tag is named FILEsequence.

What about:
"continuousnumber"
"sequencenumber"
"Counting"
"Sequenzing"
"Counter"
"numerator"

anything that only reflect (1,2,3,4,5,6,...)
Or what are you associating with filesequence?
-Mac OSX Mountain Lion-

Phil Harvey

There are already tags and/or exiftool options with the following names, so we can't use these for the new tag:

Count, Index, Number, Sequence, SequenceNumber, FileCount, FileIndex, FileNumber, FileOrder

But I still like FileSequence.  To me it makes sense because this represents the sequence in which the files were processed.  The first file processed will have sequence number 0, the second will have sequence number 1, etc.  You can of course write this FileSequence number to any tag (AllDates in this case), but it doesn't change the fact that it is the still the sequence that the files were processed by the exiftool command.

- 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 ($).

JanK

Quotethis represents the sequence in which the files were processed

No for me it makes sense too. In this fact I brought the name "file" in a wrong context. But you are right. It is a SEQUENCE which is increasing from FILE to FILE.
-Mac OSX Mountain Lion-

Phil Harvey

Great.  My plan is to release version 8.73 with this new feature on Saturday.

- 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 ($).

JanK

Works perfect! Thank you!

For all who are wondering how this can work with over 60 pictures:

0:1:20 (one minute, twenty seconds) is the same as 0:0:80 (eighty seconds)
-Mac OSX Mountain Lion-

Phil Harvey

Quote from: JanK on December 17, 2011, 01:55:31 PM
Works perfect! Thank you!

You're welcome! :)

QuoteFor all who are wondering how this can work with over 60 pictures:

0:1:20 (one minute, twenty seconds) is the same as 0:0:80 (eighty seconds)

Yes, I was thinking I should have mentioned this somewhere.  It goes further... 86400 seconds equals 1 day, so this may affect the date too if you have enough pictures.

- 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 ($).

JanK

What is wrong with
exiftool '-filename=Picture_2007-0$filesequence' DIR

And how can I start with "1" instead of "0"?
$filesequence+1??

Thanks
-Mac OSX Mountain Lion-

Phil Harvey

There are 2 ways I can think of doing this.  The 1st is the proper way, and the 2nd is a quick-and-dirty trick:

1) Create a user-defined tag based on FileSequence with this conversion: ValueConv => '$val + 1',

2) Add a dummy file to your command:

exiftool '-filename=Picture_2007-0$filesequence' tmp/dummy.jpg DIR

- 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 ($).