exiftool -photoshop:all= also removes all of the IPTC metadata

Started by drorak, June 24, 2013, 04:10:45 PM

Previous topic - Next topic

drorak

Hi,

Not sure if this is a bug or not, but if I use "exiftool -photoshop:all= *.jpg" for example. It will delete the photoshop group as expected, but it will also delete all the IPTC metadata.

Not sure if the Photoshop group is a subset of IPTC, because if I use "exiftool -all= --iptc:all *.jpg"  It deletes everything, but preserves IPTC and Photoshop.

Alternatively if I run "exiftool -all= --photoshop:all *.jpg" it preserves only the Photoshop group but deletes everything else including the IPTC group or if I run "exiftool -iptc:all= *.jpg", It will only delete the IPTC group and leave the photoshop group alone. As I would expect. (and yes, the -all= command also preserves the adobe group, but I know it's supposed to.)

I'm using version 9.3.2.0 of ExifTool and then using ExifToolGui to view the Exif data.

Basically, I just want to be able to delete everything except some of the IPTC information, but can't seem to get it to work. I would have expected "exiftool -all= --iptc:Keywords  -adobe:all= *.jpg" to work, but it doesn't, because iptc:keywords gets erased. Or if I try "exiftool -all= --ITPC:all -adobe:all = *.jpg" this doesn't work either because Photoshop is preserved as well as IPTC.

And trying to manually delete the Photoshop tags doesn't work either... ie. "exiftool -photoshop:XResolution=" doesn't work.

if this isn't a bug, is there a workaround?

Phil Harvey

From the application documentation:

            The wildcards "*" and "?" may be used in tag names to assign the
            same value to multiple tags.  When specified with wildcards,
            "unsafe" tags are not written.  A tag name of "All" is eqivalent
            to "*" (except that it doesn't require quoting, while arguments
            with wildcards do on systems with shell globbing), and is often
            used when deleting all metadata (ie. "-All=") or an entire group
            (ie. "-GROUP:All=").  Note that not all groups are deletable, and
            that the JPEG APP14 "Adobe" group is not removed by default with
            "-All=" because it may affect the appearance of the image.  Use
            the -listd option for a complete list of deletable groups, and see
            note 3 below regarding the "APP" groups.  Also, within an image
            some groups may be contained within others, and these groups are
            removed if the containing group is deleted:

              JPEG Image:
              - Deleting EXIF or IFD0 also deletes ExifIFD, GlobParamIFD,
                GPS, IFD1, InteropIFD, MakerNotes, PrintIM and SubIFD.
              - Deleting ExifIFD also deletes InteropIFD and MakerNotes.
              - Deleting Photoshop also deletes IPTC.

              TIFF Image:
              - Deleting EXIF only removes ExifIFD which also deletes
                InteropIFD and MakerNotes.


The work-around is to add the IPTC back again after deleting it:

exiftool -photoshop:all= -tagsfromfile @ -iptc:all -ext jpg .

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

drorak

Thanks Phil,

Not sure I understand the syntax yet in the example you gave... "exiftool -photoshop:all= -tagsfromfile @ -iptc:all -ext jpg"
...but I'll try to figure it out.

StarGeek

-photoshop:all=

This you should have already figured out, it will remove the photoshop chunk from the image.

-tagsfromfile @

TagsFromFile
"Copy tag values from SRCFILE to FILE. Tag names on the command line after this option specify the tags to be copied, or excluded from the copy."

"SRCFILE may be the same as FILE to move information around within a single file. In this case, @ may be used to represent the source file (ie. -tagsFromFile @), permitting this feature to be used for batch processing multiple files."

So this lets ExifTool know we're going to copy tags from one file to another.  The @ sign indicates the current file that's being processed is the one to copy the tags from.

-iptc:all

Since this is following the -tagsFromFile command, it indicates that we're going to copy the IPTC data back in.  I believe it will still create a bare Photoshop tag that doesn't have any data in it other than the IPTC.  At least that's what it looks like to me when I've checked with other programs.  ExifTool will not show that there is a Photoshop chunk.

-ext jpg

This will limit ExifTool to only processing jpgs.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Thanks StarGeek,

Just one small correction:

Quote from: StarGeek on June 25, 2013, 04:59:30 PM
ExifTool will not show that there is a Photoshop chunk.

This can be done with the -v option if you really want to see it.  But if there is IPTC in the standard location of a JPEG image then there must be a containing Photoshop segment.

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

drorak

Thanks for clearing it up.

I think I pretty much got it to work the way I want now. I stuck the following line in a batch file. Then I call that batch file when exporting from Lightroom using the Post-Processing/After Export: feature.

d:\exiftool\exiftool.exe -adobe:all= -xmp:all= -photoshop:all= -tagsfromfile @ -iptc:all -overwrite_original %*

I'm still not quite sure I understood the "-ext jpg" switch.. was that the same as saying "*.jpg"? Anyway, so far it seems to work without it.

Phil Harvey

Quote from: drorak on June 26, 2013, 01:15:41 AM
I'm still not quite sure I understood the "-ext jpg" switch.. was that the same as saying "*.jpg"?

Very similar, yes.  The main difference is that you can't recurse into subdirectories if you want with "*.jpg".  With "-ext jpg" you can add a -r switch to also process JPG images in subdirectories.

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

drorak

Thanks for answering my questions Phil, and thanks for creating a great app.