-if and Datetimeoriginal

Started by zenyo, June 17, 2016, 05:42:34 AM

Previous topic - Next topic

zenyo

First of all sorry for my bad english.

ExifTool helped me very much.but also a lot of things I do not understand about this software.

i got alot of pictures which DateTaken are "2222/1/1" and mixed which other date (check attachment)

is it possible to change date "2222/1/1" to "1994/6/17" using -if command

Thanks you

Phil Harvey

Try this:

exiftool -if "$datetimeoriginal=~/^2222:01:01/" -datetimeoriginal="1994:06:17 00:00:00" 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 ($).

zenyo

i tried with windows console and it's work. how ever i tried with -stay_open True @ it doesn't work here what i type in text file
-overwrite_original
-if "$datetimeoriginal=~/^2222:01:01/" -datetimeoriginal="1994:06:17 00:00:00"
C:\test\1.jpg
-execute


it's always say Warning : Tag if does not exist

Phil Harvey

OK then, you need to find out what date/time tag to use.  Run this command on a file to see what is available:

exiftool -time:all -a -G1 FILE

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

StarGeek

The Windows "Date Taken" property is filled from these tags, in this order:
EXIF:DateTimeOriginal
IPTC:DateCreated + IPTC:TimeCreated
XMP:CreateDate
EXIF:CreateDate
XMP:DateTimeOriginal

"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

zenyo

hello.

this is what i enter in cmd

exiftool -stay_open True -@ C:\\test\\test.arg -fast3

in test.arg i write

-overwrite_original
-if
"$datetimeoriginal=~/^2222:01:01/" -datetimeoriginal="1994:12:12 00:00:00"
C:\test\1.JPG
-execute


it's always say 1 files failed condition.File 1.jpg date taken are 2222/01/01

if i enter Phil's command it's work just fine
exiftool -if "$datetimeoriginal=~/^2222:01:01/" -datetimeoriginal="1994:06:17 00:00:00" DIR
please help


StarGeek

Remove the -fast3

From the docs.
"-fast3 avoids processing the file entirely, and returns only an initial guess at FileType and the pseudo System tags"
"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

zenyo

i removed -fast3 option but the console output still give me "1 files failed condition" error

ryerman

The arg file format is incorrect.
http://www.exiftool.org/exiftool_pod.html#other_options
From the documentation:
"The file contains one argument per line (NOT one option per line -- some options require additional arguments, and all arguments must be placed on separate lines)"

Try this:
-overwrite_original
-if
"$datetimeoriginal=~/^2222:01:01/"
-datetimeoriginal="1994:12:12 00:00:00"
C:\test\1.JPG
-execute
Windows 10 Home 64 bit, Exiftool v12.61

zenyo

thanks ryerman it's work now


-overwrite_original
-if
$datetimeoriginal=~/^2222:01:01/
-datetimeoriginal="1994:12:12 00:00:00"
C:\test\1.JPG
-execute

again thanks you guys so much

btw how can i change hours in Date Taken without touching year/month/day

ryerman

Quote from: zenyo on June 18, 2016, 11:49:27 PM
btw how can i change hours in Date Taken without touching year/month/day
Try this:
exiftool "-datetimeoriginal<${datetimeoriginal;s/(\d\d\d\d:\d\d:\d\d)(.+)/$1 HH:MM:SS/}" "Your File.jpg"
where HH, MM, SS are whatever hour, minute and seconds you want.

You can use Perl substitution operations (Regular Expressions) to modify the value of any tag.
Search the forum (using "regex") for examples, and see the documentation for the -p option.
Windows 10 Home 64 bit, Exiftool v12.61