ExifTool Forum

ExifTool => Archives => Topic started by: Archive on May 12, 2010, 08:54:37 AM

Title: Cannot remove XMP-photoshop and XMP-tiff data
Post by: Archive on May 12, 2010, 08:54:37 AM
[Originally posted by bwolf on 2009-06-28 09:02:37-07]

Hi,

I'm trying to remove the xmp-photoshop and xmp-tiff data from an image. I do so by removing all metadata and selectively copying only those parts I want in the final image (i.e. exif, iptc, xmpRights, xmpIptcCore).

My source image (MG_20090613-5631.jpg) contains all metadata.
Code:
# First I create a copy of my input image:
% cp MG_20090613-5631.jpg out.jpg

Code:
# Purge all metadata followed by selective copying:
% exiftool -v1 -all= -ThumbnailImage= -tagsFromFile MG_20090613-5631.jpg -exif:all -iptc:all -xmp-dc:all -xmp-iptcCore:all -xmp-xmpRight:all out.jpg

Code:
# Examining the result image (out.jpg) seems fine; no xmp-photoshop nor xmp-tiff mentioned. But it seems xmpIptcCore and xmpRights is missing in the image:
% exiftool -G1 -s -a out.jpg | grep -i '(photoshop|tiff)'

But examining XMP by extraction contains that information, even the unwanted xmp-tiff and xmp-photoshop information:
Code:
% exiftool -tagsFromFile out.jpg out.xmp
% vi out.xmp

So I wonder: what I'm doing wrong here. I simply want to create a image containing only xmpRights and xmpIptcCore data. I need some insight.

Thanks in advance.
Marcus
Title: Re: Cannot remove XMP-photoshop and XMP-tiff data
Post by: Archive on May 12, 2010, 08:54:37 AM
[Originally posted by exiftool on 2009-06-28 10:14:34-07]

Hi Marcus,

Other than mis-typing the XMP-XMPRights group name, this should work.
I just tried it on a sample here and it removed all but the xmp-dc, xmp-iptccore
and xmp-xmprights as desired.

However, I would suggest not deleting and rebuilding the exif because you
will lose any protected tags.  So I would do this instead:

Code:
exiftool -all= --exif:all -ThumbnailImage= -tagsFromFile MG_20090613-5631.jpg -iptc:all -xmp-dc:all -xmp-iptcCore:all -xmp-xmpRight:all out.jpg

When you do this command:

Code:
exiftool -tagsFromFile out.jpg out.xmp

You are not looking at the XMP in out.jpg.  Instead, exiftool is generating
the XMP-tiff etc tags from the EXIF information in the image.  To copy only
the XMP tags, you would have to have had to constrain exiftool to preserving
the groups by adding "-all:all" or something similar to the command line.
But in this case it would have been better to extract a binary copy of the original
XMP block, like this:

Code:
exiftool out.jpg -xmp -b > out.xmp

- Phil
Title: Re: Cannot remove XMP-photoshop and XMP-tiff data
Post by: Archive on May 12, 2010, 08:54:37 AM
[Originally posted by bwolf on 2009-06-28 12:45:56-07]

Hi Phil,

thank you for your response. I understand what you suggest and I would be happy to apply it, but in my case I'm dealing with derivate files (i.e. files derived from RAW). I resize flattened tiffs with imagemagick/convert which doesn't preserve exif information present in the tiff. Therefore I work around this limitation by copying the basic exif info to the derived final jpeg. In this case I don't need the protected information. The exif information I want is more or less just for reference if someone is interested in this data.

Thanks for clarifying the xmp output, and especially that -tagsFromFile generates the data. I will examine embedded XMP in the future with exiftool file -xmp -b.

One followup question: When I copy the data from my tiff to the resized final jpg, I see a difference between the tiff and jpeg in the iptc groups:

Code:
% exiftool -G1 -a -s MG_20090613-5702-A.tif | grep -i munich
[IPTC]          City                            : Munich
[IPTC2]         City                            : Munich

What is this IPTC2-Group and how do I copy it? I tried -iptc2:all and '-iptc#:all' but this seems not to address the group.

My DAM application seems to pick up the City and even other information from the IPTC2-Group. At least this is the remaining group where this information can reside (I compared the tiff and jpeg).

Thanks in advance and escpecially thanks for this great tool!

- Marcus
Title: Re: Cannot remove XMP-photoshop and XMP-tiff data
Post by: Archive on May 12, 2010, 08:54:37 AM
[Originally posted by exiftool on 2009-06-28 13:49:41-07]

Hi Marcus,

This gets a bit tricky.  There really shouldn't be more than one IPTC
group in an image.  ExifTool will only create a single IPTC group.
You will have to figure out which one you want to copy, then use
either "-iptc:all<1iptc:all" or "-iptc:all<iptc2:all" to copy either the
IPTC or the IPTC2 group.  (Note the leading "1" in "1IPTC" in the
first case.  This specifies that this is a family 1 group name, which
is necessary in this case because both groups belong in the same
family 0 group, which is "IPTC".)

I'm not sure this answers all of your questions, but maybe at least
it will help clear things up a bit.

- Phil
Title: Re: Cannot remove XMP-photoshop and XMP-tiff data
Post by: Archive on May 12, 2010, 08:54:37 AM
[Originally posted by bwolf on 2009-06-28 14:08:34-07]

Hi Phil,

thanks for this. It starts getting weird Smiley

- Marcus