Hi there,
some cameras have different metadata behaviour.
Now, I did it via IF in batch file with different argfiles. But this made two complete runs neccessary.
exiftool -if "$model eq 'DMC-FZ1000'" -@ execute.txt
exiftool -if "$model eq 'DMC-GH4'" -@ execute2.txt
pause
exit
It works, but can I put an -if syntax directly in the argfile?
Best regards
Matthias
Yes you can. You would use the -execute option (https://exiftool.org/exiftool_pod.html#execute-NUM).
But you need to understand that this isn't a IF THEN ELSE process. Exiftool will still go through all the files once for each if condition. In other words, it will still go through all the files checking to see if $model eq 'DMC-FZ1000 and then again to check for $model eq 'DMC-GH4. On a simple set of commands like this, it won't save you much time.
Hi StarGeek,
ok, I see.
But, it would be nice to understand how to do with the argfile.
I tried a lot, but nothing works....
argfile.txt
-r
-o
-.
-if
$model eq 'DMC-FZ1000'
-copyright=Me
-execute1
-if
$model eq 'DMC-GH4'
-copyright=You
-execute2
-d
E:\TEST\%Y%m%d/%Y%m%d_%H%M%S
-FileName<${CreateDate}_%-5f.%e
D:\EXIF-IF\Testfiles
argfile.bat
exiftool -@ argfile.txt
pause
exit
I dont't know....
Best regards,
Matthias
The thing to remember about the -execute option is that it processes all commands up to that point and does not process anything after that. That becomes the start of a new command. So if you don't include a file/directory name, then you are not going to process any files.
Your example ends up being three separate commands. Note that everything after your second -execute is processed as yet a third command
exiftool -r -o -. -if "$model eq 'DMC-FZ1000'" -copyright=Me
exiftool -if "$model eq 'DMC-GH4'" -copyright=You
exiftool -d E:\TEST\%Y%m%d/%Y%m%d_%H%M%S "-FileName<${CreateDate}_%-5f.%e" D:\EXIF-IF\Testfiles
If you have options that need to be used in both sections, you must either include those options in both sections or use the -Common_Args option (https://exiftool.org/exiftool_pod.html#common_args). Note that -Common_Args is on the command line only and cannot be included in an Args file.
There is no need to include a number with -execute in a case like this. You only need to use that if you are using the -stay_open option (https://exiftool.org/exiftool_pod.html#stay_open-FLAG).
I haven't tested it, but your args file should be something like
-r
-o
-.
-if
$model eq 'DMC-FZ1000'
-copyright=Me
-d
E:\TEST\%Y%m%d/%Y%m%d_%H%M%S
-FileName<${CreateDate}_%-5f.%e
D:\EXIF-IF\Testfiles
-execute
-r
-o
-.
-if
$model eq 'DMC-GH4'
-copyright=You
-d
E:\TEST\%Y%m%d/%Y%m%d_%H%M%S
-FileName<${CreateDate}_%-5f.%e
D:\EXIF-IF\Testfiles
Hi StarGeek,
thank you. Now I understand the way of doing a little bit more!
Best regards,
Matthias