News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

How to delete all timestamp values in a JPG?

Started by l.willms, May 14, 2012, 11:50:50 AM

Previous topic - Next topic

l.willms

I am publishing at Wikimedia a number of images of a trip, but do not want to enable people to trace the exact itinary of my journey.

I want to keep the GPS tags (some of which I added myself with Geosetter), so do want to let people know where I had been, or rather where the objects pictured are located, but not when and in what time sequence I have visited those places.

I looked at the output of an "exiftool -h" and am overwhelmed - I can't see the wood for the trees.

I know that aqlso there are a lot of different timestamps in the metadata; just looking into one with Opanda, I find four, including GPStimestamp (which should go away, too).

Ah, I am using Exiftool under Windows XP.

Phil Harvey

This command will remove the common date/time tags, plus the GPS date and time:

exiftool -alldates= -gpsdatestamp= -gpstimestamp= some.jpg

There may be other date/time tags in the file, to see all of them use this command:

exiftool -a -s -time:all some.jpg

Then add any extra tags you see in this output to the first command to remove them too.  Note that some date/time tags like FileModifyDate aren't deletable.

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

l.willms

Thanks a lot!

BTW, asking a question is the first step to find out ... so I found out at least the basic command shown by you.

So I will stumble my way further into the realm of knowledge.  :)


l.willms

The next stumbling block was to use the second command proposed by the Author, by which I found out that a number of DateTimeStamps were left in the image file. The first 8 lines below show the timestamps left over, and in the second block of lines I have marked with an asterisk * all those items which were left over and with # those which had effectively been deleted with the -AllDates= option (plus one GPS-time). Of course the FileModifyDate reflects the actual last change to the file itself, unrelated to the image contained in the file.


FileModifyDate                  : 2012:05:14 18:52:09+02:00
DateCreated                     : OrigDate
TimeCreated                     : 12:02:55+01:00
DateTimeDigitized               : OrigDate 12:02:55+01:00
GPSDateTime                     : OrigDate 11:02:56Z
DateCreated                     : OrigDate 12:02:55+01:00
DateTimeCreated                 : OrigDate 12:02:55+01:00
DateTimeOriginal                : OrigDate 12:02:55+01:00


* FileModifyDate                  : 2012:02:18 20:45:08+01:00
# ModifyDate                      : OrigDate 12:08:59
# DateTimeOriginal                : OrigDate 12:08:59
# CreateDate                      : OrigDate 12:08:59
# GPSTimeStamp                    : 11:09:00.301
# GPSDateStamp                    : OrigDate
* DateCreated                     : OrigDate
* TimeCreated                     : 12:08:59+01:00
* DateTimeDigitized               : OrigDate 12:08:59+01:00
* DateTimeOriginal                : OrigDate 12:08:59+01:00
# GPSDateTime                     : OrigDate 11:09:00Z
* DateCreated                     : OrigDate 12:08:59+01:00
# ModifyDate                      : OrigDate 12:08:59+01:00
* DateTimeCreated                 : OrigDate 12:08:59+01:00
* GPSDateTime                     : OrigDate 11:09:00.301Z


I guess that I should try and create my own shortcuts...

I have to add that those images had already been treated with Exiftool before, indirectly by using Geosetter. I guess that some of the repeated Timestamps are in the EXIF and IPTC sections of the metatags. Is there a way to address these sections directly, so that equal named tags are removed from both sections?

----
Ah, one more info: the images are taken with a Canon compact camera (SX 230 HS), with GPS

Phil Harvey

You can add the -G option to the command when reading to see where the tags are located (called the "group" in ExifTool jargon).

Just specifying a tag without a group will write all tags with that name.  Alternatively, you can specify -group:tag= to target a specific one.

The AllDates tag is a shortcut for the common EXIF date/time tags: DateTimeOriginal, CreateDate and ModifyDate.

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

l.willms

Thanks again for the prompt answer! This is really very helpful!

Quote from: Phil Harvey on May 14, 2012, 01:25:51 PM
You can add the -G option to the command when reading to see where the tags are located (called the "group" in ExifTool jargon).

   Which results in this:


[File]          FileModifyDate                  : 2012:02:18 20:45:08+01:00
[EXIF]          ModifyDate                      : OrigDate 12:08:59
[EXIF]          DateTimeOriginal                : OrigDate 12:08:59
[EXIF]          CreateDate                      : OrigDate 12:08:59
[EXIF]          GPSTimeStamp                    : 11:09:00.301
[EXIF]          GPSDateStamp                    : OrigDate
[IPTC]          DateCreated                     : OrigDate
[IPTC]          TimeCreated                     : 12:08:59+01:00
[XMP]           DateTimeDigitized               : OrigDate 12:08:59+01:00
[XMP]           DateTimeOriginal                : OrigDate 12:08:59+01:00
[XMP]           GPSDateTime                     : OrigDate 11:09:00Z
[XMP]           DateCreated                     : OrigDate 12:08:59+01:00
[XMP]           ModifyDate                      : OrigDate 12:08:59+01:00
[Composite]     DateTimeCreated                 : OrigDate 12:08:59+01:00
[Composite]     GPSDateTime                     : OrigDate 11:09:00.301Z


Quote from: Phil Harvey on May 14, 2012, 01:25:51 PM
Just specifying a tag without a group will write all tags with that name.  Alternatively, you can specify -group:tag= to target a specific one.

  I think I will settle with specifying a "myTimeStamps" in the Config file with the tag names specified once, without the groups.

Quote from: Phil Harvey on May 14, 2012, 01:25:51 PM
The AllDates tag is a shortcut for the common EXIF date/time tags: DateTimeOriginal, CreateDate and ModifyDate.

   But probably with an implicit "group" name before it, like
          EXIF:DateTimeOriginal, EXIF:CreateDate and EXIF:ModifyDate
  right?


l.willms

Well, the config file which I created was obviously syntactically wrong, although I couldn't see any error.

So I created a CMD file named delTimesEXIF.cmd in the same directory where the exiftool.exe is located (and which is on the PATH), and containing this one single line

exiftool -CreateDate= -DateCreated= -DateTimeCreated= -DateTimeDigitized= -DateTimeOriginal= -GPSDateStamp= -GPSDateTime= -GPSTimeStamp= -ModifyDate= -TimeCreated= %1

and that works. the exiftool -G -a -s -time:all *.jpg did not report any more DateTime items (except the file change time stamp, showing the exectution time of the previous exiftool execution).

This matter is closed now (er, perhaps only for the time being?); the correct construction of the config file is a separate task which I will try and tackle later.


l.willms

Well ... it ain't over till its over.

I now tried my CMD file with another group of 11 JPG files, and exiftool told me this:

Quote
exiftool -CreateDate= -DateCreated= -DateTimeCreated= -DateTimeDigitized= -DateTimeOriginal= -GPSDateStamp= -GPSDateTime= -GPSTimeStamp= -ModifyDate= -TimeCreated= *.jpg

Search pattern not terminated at Image/ExifTool/PNG.pm line 970.
Compilation failed in require at (eval 19) line 3.
Can't find table Image::ExifTool::PNG::TextualData
Warning: Sorry, DateTimeCreated is not writable
Can't find table Image::ExifTool::PNG::Main
   11 image files updated

  A problem? Maybe partially result that there is no config-file at all in the reach of exiftool.exe?

A check with the -time:ALL did not reveal any timestamps left over.

Phil Harvey

Quote from: l.willms on May 14, 2012, 02:24:06 PM
          EXIF:DateTimeOriginal, EXIF:CreateDate and EXIF:ModifyDate

No.

Quote from: l.willms on May 14, 2012, 04:34:50 PM
So I created a CMD file named delTimesEXIF.cmd

Another alternative is an argument file.  See the -@ option.

Quote from: l.willms on May 14, 2012, 05:57:34 PM
Search pattern not terminated at Image/ExifTool/PNG.pm line 970.
Compilation failed in require at (eval 19) line 3.
Can't find table Image::ExifTool::PNG::TextualData

This looks like PNG.pm is corrupted.  Try uninstalling and re-installing.

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

l.willms

#9
Quote from: Phil Harvey on May 15, 2012, 07:20:18 AM
Quote from: l.willms on May 14, 2012, 05:57:34 PM
Search pattern not terminated at Image/ExifTool/PNG.pm line 970.
Compilation failed in require at (eval 19) line 3.
Can't find table Image::ExifTool::PNG::TextualData

This looks like PNG.pm is corrupted.  Try uninstalling and re-installing.

The problem arose from me copying exiftool.exe from C:\programme\Geosetter\tools to the UTIL directory on the PATH, and this was exiftool.exe version 8.47, dated January 2011. I had always installed the latest exiftool.exe when Geosetter asked me to do so, but those newer exiftool.exe versions were installed under the user-specific "Application Date" folder, and not under the programme\exiftool folder.

In the "par-<username>" subdirectory of the TEMP directory were three further subdirectories, namely cache-exiftool-8.89, cache-exiftool-8.88, and cache-exiftool-8.47. I deleted the latter two, copied the latest exiftool.exe (8.89) to my UTIL directory, ran my delTimesEXIF.cmd again, and then got only the Warning: Sorry, DateTimeCreated is not writable, but not the ones regarding PNG.pm.

I guess that warning says that the tag DateTimeCreated was not present in one or more of those image files changed.

Thanks again for all the great and prompt support!



Phil Harvey

I'm glad to hear that deleting the temporary files solve the PNG.pm problem.

DateTimeCreated is a Composite tag, and is not writable.  It is derived from IPTC:DateCreated and IPTC:TimeCreated.  So deleting these IPTC tags effectively deletes DateTimeCreated.

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

cjoshua

I am pretty sure that the timestamp present here would particularly be on the exif file and everything that is included to it.  And in that sense,the best way is to attack it from there.  Why not try how that would solve the problem.  But please do not quote me on this and how it should turn out depends on every implementation that you see fit with it.