ExifTool Forum

ExifTool => Newbies => Topic started by: minty2b on August 24, 2022, 11:30:10 PM

Title: Remove everything except creation date
Post by: minty2b on August 24, 2022, 11:30:10 PM
I have had a good look around the documentation and forum first but I am unable to get this working to delete all information from an image file and keep the correct create date and time. I'm on an M1 Mac.

This didn't work - it said files unchanged
exiftool -all= '/Users/me/Documents/Folder'
This didn't work - it said files unchanged
exiftool -all:all= '/Users/me/Documents/Folder'
This worked but changed the creation date to the current time (obviously, but I wanted to check the path was correct)
exiftool -all= -filecreatedate=now '/Users/me/Documents/Folder'

I am trying to remove everything it can from image files except the original creation date/time but I am not sure what the command should look like. Any advice would be much appreciated.
Title: Re: Remove everything except creation date
Post by: StarGeek on August 25, 2022, 03:32:31 AM
The file system tags cannot be removed.  That will be things like permission, file size, the FileCreateDate/FileModifyDate and similar things.  These are not embedded in the file but are part of the underlying OS. There are also properties of the file, like image size and BitsPerSample that are properties of the file.  Then there are the Composite group tags, which are also not embedded in the file, but are derived from other tags and created on the fly

When you run the command in FAQ #3 (https://exiftool.org/faq.html#Q3), anything in the System group and most File group tags are not things that can be removed.

If your first two commands said the file was unchanged, then there isn't any data in the file that exiftool can remove.
Title: Re: Remove everything except creation date
Post by: wywh on August 25, 2022, 03:36:54 AM
I presume you mean file dates, right? Try:

exiftool -m -P -overwrite_original_in_place -wm w -all= -Adobe= .

or just:

exiftool -P -all= -Adobe= .

Somehow Adobe needs special attention?

Check the results:

exiftool -a -G1 -s .

Or more details:

exiftool -a -G1 -s -api RequestAll=2 .

But file dates are fragile and might be accidentally changed with many workflows.

- Matti
Title: Re: Remove everything except creation date
Post by: StarGeek on August 25, 2022, 12:05:11 PM
Quote from: wywh on August 25, 2022, 03:36:54 AMSomehow Adobe needs special attention?

It needs to be specifically deleted because removing it can alter the image's colors.  See this post (https://exiftool.org/forum/index.php/topic,6448.msg32114.html#msg32114) for examples.

There's no personally identifiable data in the Adobe group, so there really isn't a need to remove it.
Title: Re: Remove everything except creation date
Post by: minty2b on September 03, 2022, 09:33:38 PM
Quote from: StarGeek on August 25, 2022, 12:05:11 PM
Quote from: wywh on August 25, 2022, 03:36:54 AMSomehow Adobe needs special attention?

It needs to be specifically deleted because removing it can alter the image's colors.  See this post (https://exiftool.org/forum/index.php/topic,6448.msg32114.html#msg32114) for examples.

There's no personally identifiable data in the Adobe group, so there really isn't a need to remove it.

Yes, that is also the issue I noticed it will strip everything which isn't ideal, I am struggling to put together a line of code that won't change any colour profiles but will just protect my privacy by removing some of the more specific information like location, camera etc. If you have any advice I would be grateful.
Title: Re: Remove everything except creation date
Post by: StarGeek on September 05, 2022, 11:16:27 AM
Quote from: minty2b on September 03, 2022, 09:33:38 PMYes, that is also the issue I noticed it will strip everything which isn't ideal, I am struggling to put together a line of code that won't change any colour profiles but will just protect my privacy by removing some of the more specific information like location, camera etc. If you have any advice I would be grateful.

To remove everything but keep color data, you could try
exiftool -All= -TagsFromFile @ -ColorSpaceTags /path/to/files/

ColorSpaceTags is a shortcut for the ICC_Profile and a few other color related tags. The -All= removes everthing but the -TagsFromFile option (https://exiftool.org/exiftool_pod.html#tagsFromFile-SRCFILE-or-FMT) copies the color data back in.

If you want to be more selective, you would have to use FAQ #3 (https://exiftool.org/faq.html#Q3) to figure out what you want to keep and what you want to remove.  If there are more things to remove than keep, just add the tag names you want to keep after -TagsFromFile @ in the above command.  If you want to keep more than remove, just clear them directly.

exiftool -GPSLatitude= -GPSLongitude= -Make= -Model= /path/to/files/

You can also use wildcards to remove similar items.  For example, to remove all tags starting with GPS
exiftool -GPS*= /path/to/files/
Title: Re: Remove everything except creation date
Post by: wywh on September 05, 2022, 11:57:20 AM
Are JFIF tags worth preserving?

[JFIF]          JFIFVersion                     : 1.01
[JFIF]          ResolutionUnit                  : None
[JFIF]          XResolution                     : 1
[JFIF]          YResolution                     : 1
Title: Re: Remove everything except creation date
Post by: StarGeek on September 05, 2022, 12:15:02 PM
I think some programs might read the resolution data, but there could also be resolution data elsewhere in the file.

It's a very small chunk with no data that can identify a person, so it can be removed or left alone.  Doesn't really make much of a difference.
Title: Re: Remove everything except creation date
Post by: minty2b on September 22, 2022, 11:23:46 PM
Quote from: StarGeek on September 05, 2022, 11:16:27 AMTo remove everything but keep color data, you could try
exiftool -All= -TagsFromFile @ -ColorSpaceTags /path/to/files/

ColorSpaceTags is a shortcut for the ICC_Profile and a few other color related tags. The -All= removes everthing but the -TagsFromFile option (https://exiftool.org/exiftool_pod.html#tagsFromFile-SRCFILE-or-FMT) copies the color data back in.

If you want to be more selective, you would have to use FAQ #3 (https://exiftool.org/faq.html#Q3) to figure out what you want to keep and what you want to remove.  If there are more things to remove than keep, just add the tag names you want to keep after -TagsFromFile @ in the above command.  If you want to keep more than remove, just clear them directly.

exiftool -GPSLatitude= -GPSLongitude= -Make= -Model= /path/to/files/

You can also use wildcards to remove similar items.  For example, to remove all tags starting with GPS
exiftool -GPS*= /path/to/files/

You are so awesome, that is perfect for what I need  ;D