Delete All; Save IPTC and DateTimeOriginal

Started by nbc2, September 29, 2013, 06:34:58 PM

Previous topic - Next topic

nbc2

I'm attempting to delete all EXIF except (i) IPTC, and (ii) DateTimeOriginal.  To date, I've been unsuccessful.  To get close, my present approach is:

exiftool -all= --iptc:all -DateTimeOriginal='YYYY:MM:DD HH:MM:SS' File

The action, however, deletes all IPTC data; in addition, it resets all DateTimeOriginal to the chosen numbers [with it, though, I can add back in the IPTC data and I'm relatively close to my goal].  As stated above, I'd like to retain the IPTC and DateTimeOriginal.

Any thoughts, Phil or other forum members?

Background:
~ Running exiftool within Terminal under Mac OS X v 10.8.5; and
~ Working with *.jpg files created from *.nef files

Phil Harvey

From the application documentation:

       --TAG
            Exclude specified tag from extracted information.  Same as the -x
            option.  Once excluded from the output, a tag may not be re-
            included by a subsequent option.  May also be used following a
            -tagsFromFile option to exclude tags from being copied (when
            redirecting to another tag, it is the source tag that should be
            excluded), 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.


So, try something like this:

exiftool -all= -tagsfromfile @ -iptc:all -datetimeoriginal 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 ($).

nbc2

#2
Thanks, Phil.  Worked in part: saved DateTimeOriginal but did not save any IPTC data (using both Photo Mechanic and iExifer to check).  Any further thoughts or ideas?


[addendum]:
The following seems to work:

Photo Mechanic > Preferences > IPTC/XMP > 'When writing IPTC/XMP' > 'For JPEG, TIFF, PSD, DNG photos' > uncheck the box next to 'Add embedded IPTC (XMP will always be written)' [where the quotes indicate text within a portion of the PM preference dialog box]

For each photo in question (of course, for multiple photos, use batching to aggregate work into single steps):
Photo Mechanic > input 'IPTC Info' on the 'IPTC Stationary Pad' [where the quotes indicate descriptive text used by PM]

exiftool -all= -tagsfromfile @ -xmp:all -datetimeoriginal File

Phil Harvey

Quote from: nbc2 on September 29, 2013, 07:59:21 PM
Thanks, Phil.  Worked in part: saved DateTimeOriginal but did not save any IPTC data (using both Photo Mechanic and iExifer to check).  Any further thoughts or ideas?

If IPTC is there (in IIM format), then this will work.  If the IPTC is stored in the XMP, then you would need a different command.

Quoteexiftool -all= -tagsfromfile @ -xmp:all -datetimeoriginal File

Yeah, like that.

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

nbc2

Thanks, Phil.  In practice today, the code -- with the expansion noted below -- worked very well:

exiftool -all= -tagsfromfile @ -xmp:all -datetimeoriginal -ext .JPG DIR