News:

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

Main Menu

Remove metadata except... I seem to be doing what documentation says, but...

Started by thaddeusf, May 30, 2020, 11:12:58 AM

Previous topic - Next topic

thaddeusf

Hello,

I've read the document and many threads about this topic, but still I cannot get this seemingly easy task complete.  This command clears all tags:

"F:\Restoration Projects\Granny BOOK Project\exiftool.exe" -all= --CreateDate --Description --Title --Source "Martha Pemberton-1901.jpg"

I'm trying to get rid of all metadata except for CreateDate, Description, Tital and Source on the jpg. In my many experiments, the tag which seems to the most problematic is CreateDate. Can someone please let me know what I'm doing wrong with the syntax?

Thank you.

StarGeek

Quote from: thaddeusf on May 30, 2020, 11:12:58 AM
I'm trying to get rid of all metadata except for CreateDate, Description, Tital and Source on the jpg.

Try
exiftool  -all= -TagsFromFile @ -CreateDate -Description -Title -Source "Martha Pemberton-1901.jpg"

I can't find the exact part of the docs but using -all= deletes full group blocks and you can't exclude individual tags when deleting blocks.  So you have to use the -TagsFromFile option to copy the specific data back into the file.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

thaddeusf

Thanks. This is definitely better, but I'm still having problems with CreateDate. The output is from the command is:

F:\Restoration Projects\Granny BOOK Project\Chronological>"F:\Restoration Projects\Granny BOOK Project\exiftool.exe" -all= -TagsFromFile @ -CreateDate -Description -Title -Source "Martha Pemberton-1901.jpg"
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in ExifIFD:CreateDate (PrintConvInv) - Martha Pemberton-1901.jpg
    1 image files updated

I'm sure the reason for this is value is 1901 and not the fully qualified data/time. Yet, everything else seems to work with just the year. Do I have to put in 1901:01:01 or something? I'd really rather stay with just the year.

Thanks.

thaddeusf

I changed the CreateDate format to 1901:01:01 and am still having the problem:

Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in ExifIFD:CreateDate (PrintConvInv) - Martha Pemberton-1901.jpg
    1 image files updated

It's possible to deal with the long date, but is there surely be a way to avoid using the whole timestamp format. Was it a mistake to use the CreateDate tag? It seemed most appropriate?

Thanks.

thaddeusf

AND,

Why did I not have the same CreateDate formatting problem when doing this command?

"F:\Restoration Projects\Granny BOOK Project\exiftool.exe" . -csv="Chronological.csv" -overwrite_original

When in the CSV I have:
SourceFile   CreateDate   Description   Title   Source
Martha Pemberton-1901.jpg   1901   Joseph Pemberton - Studio Portrait, Unknown location   Martha Essie Pemberton Book of Life   Martha Elizabeth

You would think exiftool would have had the same warning when writing a year only CreateDate then too, but is doesn't.

Thanks.



thaddeusf


This seems to get me through...

"F:\Restoration Projects\Granny BOOK Project\exiftool.exe" -all= -TagsFromFile @ -CreateDate -Description -Title -Source -d %Y "Martha Pemberton-1901.jpg"

Although the entry in metadata becomes "1901:01:01 00:00:00" instead of the previous "1901"

Perhaps better to stick with the expected format?
Thanks.

StarGeek

See FAQ #5
    The standard EXIF date/time format is "YYYY:mm:dd HH:MM:SS",

CreateDate is a EXIF tag, so it needs to be set to that format.

There an XMP version of CreateDate that will allow incomplete dates.

Also, you can force an incomplete date into the EXIF:CreateDate by adding a hashtag to the end of the tag, e.g. -CreateDate#=1901  See the -n (printConv) option for details.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

StarGeek

Quote from: thaddeusf on May 30, 2020, 11:53:36 AMWhy did I not have the same CreateDate formatting problem when doing this command?

"F:\Restoration Projects\Granny BOOK Project\exiftool.exe" . -csv="Chronological.csv" -overwrite_original
...
You would think exiftool would have had the same warning when writing a year only CreateDate then too, but is doesn't.

You probably have an XMP:CreateDate tag already in that file and that gets updated.  Run the command listed in FAQ #3 to see duplicates and the groups they belong to.

When I run a similar csv (has 1901 for the CreateDate) on a file that doesn't have the XMP:CreateDate, only the EXIF:CreateDate, I get a 0 image files updated response.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

thaddeusf

Thank you StarGeek.  I've wondered if there are advantages of adding the same information in both the EXIF and XMP tags. Presumably it might make for wider software support of the resulting jpgs?

If I were to do this, I guess the csv columns would be EXIF:CreateData and XMP:CreateDate?

I've finally got my commands down and running. I'll be writing a short guide for leveraging metadata for keeping track of old picture dates and captions. Most of the projects people seem to be using exiftool for are hugely complicated and us little guys can get lost in our simple world.  :)

Thank you for all the help.

Phil Harvey

Quote from: thaddeusf on May 30, 2020, 02:06:54 PM
I've wondered if there are advantages of adding the same information in both the EXIF and XMP tags. Presumably it might make for wider software support of the resulting jpgs?

Not a bad idea.

QuoteIf I were to do this, I guess the csv columns would be EXIF:CreateData and XMP:CreateDate?

EXIF:CreateDate.  Yes.

- 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

Quote from: thaddeusf on May 30, 2020, 02:06:54 PM
I've wondered if there are advantages of adding the same information in both the EXIF and XMP tags. Presumably it might make for wider software support of the resulting jpgs?

Potentially, yes, though most software will probably prioritize the EXIF data.  Not all programs may be able to process incomplete dates, so it seems pretty common to set the other parts of the dates to the minimum.  For example, 1901 might be set as 1901:01:01 00:00:00 as you did.

To be technical, the EXIF spec does allow for partial date/time, expecting blank spaces where there is data missing, so "1901:  :     :  :  " would be according to the spec.  But again, some programs might not be able to process that.  For example, Adobe Bridge leaves the values blank unless it's at least filled out to the date level, e.g. 1901:01:01. 
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).