ExifTool Forum

ExifTool => Newbies => Topic started by: DELETEACCOUNT on December 07, 2012, 10:36:53 AM

Title: Time!
Post by: DELETEACCOUNT on December 07, 2012, 10:36:53 AM
Hello!

The last days i tried to figure out how exiftool works, but there are some questions left, hope you can help me!

I have a bunch of picture shot in 2004...  What i want to do is to delete all the Metadata (exiftool -all=) but keep all the dates/times in the file!
is that somehow possible?

If i display all the times available in one file (exiftool -a G1 -s -time:all FILE) it looks like this:

FileModifyDate                                    : 2004:08:19 13:44:28+02:00
FileAccessDate                                    : 2012:12:07 16:00:20+01:00
FileCreateDate                                    : 2012:12:07 16:00:20+01:00
ModifyDate                                         : 2004:08:19 14:44:27
DateTimeOriginal                                : 2004:08:19 14:44:27
CreateDate                                         : 2004:08:19 14:44:27

but if i use the command to delete Metadata (exiftool -all=) there will be only this left: so there is no original time left when the photo was taken and ModifyDate, DateTimeOriginal, CreateDate is gone :-( 

FileModifyDate                                    : 2012:12:07 16:10:02+01:00
FileAccessDate                                    : 2012:12:07 16:10:02+01:00
FileCreateDate                                    : 2012:12:07 16:00:20+01:00

Sorry for my bad english :-( How can i solve this?

Thank you!
Title: Re: Time!
Post by: Phil Harvey on December 07, 2012, 10:50:57 AM
Reading this section of the application documentation may help:

--TAG

    Exclude specified tag from extracted information. Same as the -x option. May also be used
    following a -tagsFromFile option to exclude tags from being copied, or to exclude groups from
    being deleted when deleting all information (ie. -all= --exif:all deletes all but EXIF information).
    But note that this will not exclude individual tags from a group delete. Instead, individual tags
    may be recovered using the -tagsFromFile option (ie. -all= -tagsfromfile @ -artist). Wildcards
    are permitted as described above for -TAG.

- Phil
Title: Re: Time!
Post by: DELETEACCOUNT on December 07, 2012, 11:16:27 AM
Hi Phil! Thanks for your fast reply

So i tried this now (just to see if it deletes everything except the EXIF data)

exiftool -all= --exif:all FILE (location of file)

but the following Warning appeared:
Warning: [minor] Adjusted MakerNotes base by -264 - FILE (location of file)
0 image files updated
1 image files unchanged
Title: Re: Time!
Post by: Phil Harvey on December 07, 2012, 11:19:44 AM
It looks like there was only EXIF information in this file.

- Phil
Title: Re: Time!
Post by: DELETEACCOUNT on December 07, 2012, 11:58:19 AM
Thanks Phil!

instead of exif:all i hat to use exifIFD:all --> then it worked very well...

so i went one step further just leaving all the times left with:

exiftool -all= -tagsfromfile @ -CreateDate -ModifyDate -DateTimeOriginal FILE

so it looks like this now: exactly what i wanted...

[System]        File Modification Date/Time        : 2012:12:07 17:46:03+01:00
[System]        File Access Date/Time                : 2012:12:07 17:50:08+01:00
[System]        File Inode Change Date/Time     : 2012:12:07 17:46:03+01:00
[IFD0]            Modify Date                               : 2004:08:25 13:01:03
[ExifIFD]        Date/Time Original                     : 2004:08:25 13:01:03
[ExifIFD]        Create Date                               : 2004:08:25 13:01:03

But one last thing: There will be a new *.jpg created and when i open it in my Mac Finder
the Created, Modified, Last Opened dates are set to today and not the date the picture was taken... (see the attachment)
I guess the Finder on the mac just reads the [System] Times since the Exif Dates are correct...

So how can i change the System Dates (Created, Modified)?  to the Exif Dates?





Title: Re: Time!
Post by: Phil Harvey on December 07, 2012, 12:23:10 PM
You can use the -P option to preserve the FileModifyDate.  The only way to preserve the file creation date is to use -overwrite_original_in_place, but this is not the best solution since it is slow and will overwrite the original.

If the FileModifyDate has already been changed, you can set it to the EXIF ModifyDate with "-filemodifydate<modifydate" in the command.

- Phil
Title: Re: Time!
Post by: DELETEACCOUNT on December 07, 2012, 12:31:54 PM
Hi Phil! Thanks a lot!

I just managed to change the FileModifyDate and FileAccessDate by using

DateTimeOriginal>FileModifyDate so it looks like:

FileModifyDate                                    : 2004:08:19 14:44:27+02:00
FileAccessDate                                    : 2004:08:19 14:44:27+01:00
FileCreateDate                                    : 2012:12:07 16:00:20+01:00
ModifyDate                                         : 2004:08:19 14:44:27
DateTimeOriginal                                : 2004:08:19 14:44:27
CreateDate                                         : 2004:08:19 14:44:27

but if i want to change the FileCreateDate with:

DateTimeOriginal>FileCreateDate

doesn't work...just says nothing after i pressed the Enter button..
how can i change the FileCreateDate?

By the way what does the +2:00 and +1:00 in the FileAccessDate and FileModifyDate mean?
Title: Re: Time!
Post by: Phil Harvey on December 07, 2012, 12:42:27 PM
Unfortunately the FileCreateDate tag is not available in ExifTool on Mac systems.  There is a work-around that may allow you to set this.  See the FileCreateDate tag notes in the Extra tags documentation (https://exiftool.org/TagNames/Extra.html) for details.

The +02:00 and +01:00 are the time zone offset of your system at these times.

- Phil
Title: Re: Time!
Post by: DELETEACCOUNT on December 07, 2012, 12:46:44 PM
I did the whole editing in windows... :-) so it should work?
Title: Re: Time!
Post by: Phil Harvey on December 07, 2012, 12:49:14 PM
In Windows you should be able to set the FileCreateDate if you are using ExifTool 9.07 or later.

- Phil
Title: Re: Time!
Post by: DELETEACCOUNT on December 07, 2012, 01:59:07 PM
Thanks Phil everything worked!

only one more thing:

I managed to change the CreateDateFile so it looks like this:

FileModifyDate                                    : 2004:08:19 14:44:27+01:00
FileAccessDate                                    : 2004:08:19 14:44:27+01:00
FileCreateDate                                    : 2004:08:19 14:44:27+01:00
ModifyDate                                         : 2004:08:19 14:44:27
DateTimeOriginal                                : 2004:08:19 14:44:27
CreateDate                                         : 2004:08:19 14:44:27

but when i close the cmd.exe and read the file again, the FileCreateDate is again changed to todays date :-(
???

Title: Re: Time!
Post by: Phil Harvey on December 07, 2012, 02:12:46 PM
That is no good.  I'll have to test this when I get a chance.

- Phil
Title: Re: Time!
Post by: DELETEACCOUNT on December 07, 2012, 02:18:49 PM
Hey Phil!

Just found out why:

The photo i changed with exiftool (all the 6 times) stays the same... in Windows if you do a do a copy of that file the FileCreateDate will be changed... (for example a copy of the original to a usb flash drive)
But: if you cut it out with CTRL - X and then paste it it wont change...

so i think its not exiftool, its windows that messes this up.. :-)

Another Question:
I have some scanned Images with no MetaData... is there a way to create Exif Tags for ModifyDate, DateTimeOriginal and CreateDate?
Title: Re: Time!
Post by: Phil Harvey on December 07, 2012, 02:21:17 PM
Quote from: GuitarMaster on December 07, 2012, 02:18:49 PM
Another Question:
I have some scanned Images with no MetaData... is there a way to create Exif Tags for ModifyDate, DateTimeOriginal and CreateDate?

Yes:

exiftool -alldates="SOME DATE" FILE

or

exiftool "-alldates<filemodifydate" FILE

"AllDates" is a shortcut for DateTimeOriginal, CreateDate and ModifyDate.

- Phil
Title: Re: Time!
Post by: DELETEACCOUNT on December 07, 2012, 02:48:09 PM
Thank You !!!! GREAT!!

Title: Re: Time!
Post by: DELETEACCOUNT on December 08, 2012, 04:47:31 AM
Hey Phil! Hope you still read this post...

Will there be some kind of Shortcut function for all the System Times in Future versions of ExifTool? like the "-AllDates" (changes all EXIF Dates)
Title: Re: Time!
Post by: Phil Harvey on December 08, 2012, 07:18:18 AM
There are no plans to add a shortcut for the system date/time tags, but you can always create your own user-defined shortcuts.  See the Shortcuts section of the sample ExifTool config file (https://exiftool.org/config.html) for details.

- Phil
Title: Re: Time!
Post by: DELETEACCOUNT on December 09, 2012, 07:46:07 AM
Super!

one more question:

These are the times/dates of a picture:

FileModifyDate                                    : 2004:08:19 14:44:27+01:00
FileAccessDate                                    : 2004:08:19 14:44:27+01:00
FileCreateDate                                    : 2004:08:19 14:44:27+01:00
ModifyDate                                         : 2004:08:19 14:44:27
DateTimeOriginal                                : 2004:08:19 14:44:27
CreateDate                                         : 2004:08:19 14:44:27


The ExifTimes (ModifyDate, DateTimeOriginal, CreateDate) are the exact times/dates the picture was taken (local time in that country that day)
on the Mac, the finder displays the System times... so because of the Time Zone it says +1:00 which is not the local time the picture was taken.

So is there something that i can just delete that TimeZone information? so that it looks like:

FileModifyDate                                    : 2004:08:19 14:44:27
FileAccessDate                                    : 2004:08:19 14:44:27
FileCreateDate                                    : 2004:08:19 14:44:27
ModifyDate                                         : 2004:08:19 14:44:27
DateTimeOriginal                                : 2004:08:19 14:44:27
CreateDate                                         : 2004:08:19 14:44:27

Thanks!

Title: Re: Time!
Post by: Phil Harvey on December 09, 2012, 08:17:18 AM
I don't understand.  ExifTool always displays timezone information if it is available, and this can't be deleted from the System tags because the system always knows the time zone.  The real unfortunate thing is that the timezone isn't stored in the EXIF tags (this is a BIG oversight in the EXIF specification).

But if you just want to remove the timezone from the displayed information, you could create a user-defined Composite tag to do this.  Then you could have a Composite:FileModifyDate tag which didn't have a timezone, and this tag would be displayed instead of the System:FileModifyDate tag unless you used the -a option (in which case both would be displayed).

- Phil