exclude tags (iptc) - problems

Started by Archive, May 12, 2010, 08:54:09 AM

Previous topic - Next topic

Archive

[Originally posted by goddert on 2007-10-04 14:53:16-07]

Seems I repeat myself but that's not the case ...

I tried a similar operation like the one some day ago and was stopped by a behaviour of exiftool which I can't explain. I cannot exclude that the problem is on my part as I still hassle with the structures of families, groups, tags, "subtags" etc.

Exiftool 3.99pre, Windows XP

I did an output with -a -s -u -iptc:all image.jpg to get my keywords. All worked fine.

Code:
[IPTC]          Application Record Version      : 2
[IPTC]          Keywords                        : Apulia, Cielo, IonianSea, Italia, Italy, MareIonico, Puglia, Sky, Torre, TorreLapillo, Tower
    1 directories scanned
    1 image files read

If I try to delete all except the beloved iptc keywords above with "exiftool -all= --iptc:all image.jpg" it deletes all. But this time during the operation it states (as you can see from the -v3 output attached) to remove the iptc group from the delete list but it deletes the group nevertheless. Obviously I tried to exclude them by another group as I read in the doc that iptc is part of app13 (which I believed to see also in the -v3 output). But the iptc group in my image doesn't belong to the group app13. But here I'm sure that it is my failure because maybe I didn't understand well the concept of groups/tags.

I don't succeed to exclude them in any way. Also because after a time the game becomes try and error and that's not the way to go. Where do I fail?

Anyway attached an output of "exiftool -v3 -all= --iptc:all image.jpg"

Thanks for any help in advance

Code:
Deleting all AFCP tags
Deleting all CanonVRD tags
Deleting all CIFF tags
Deleting all Ducky tags
Deleting all EXIF tags
Deleting all ExifIFD tags
Deleting all File tags
Deleting all FlashPix tags
Deleting all FotoStation tags
Deleting all GPS tags
Deleting all ICC_Profile tags
Deleting all IFD0 tags
Deleting all IPTC tags
Deleting all JFIF tags
Deleting all MakerNotes tags
Deleting all Meta tags
Deleting all MetaIFD tags
Deleting all MIE tags
Deleting all PhotoMechanic tags
Deleting all Photoshop tags
Deleting all PNG tags
Deleting all PrintIM tags
Deleting all RMETA tags
Deleting all Trailer tags
Deleting all XMP tags
Deleting all * tags
Removed group IPTC from delete list
======== ./20070907-130615.jpg
Rewriting ./20070907-130615.jpg...
  Editing tags in: * AFCP APP0 APP1 APP12 APP13 APP2 APP3 APP5 CIFF COM CanonVRD Comment Ducky ExifIFD FlashPix FotoStation GPS ICC_Profile IFD0 JFIF MIE MakerNotes Meta MetaIFD PNG PhotoMechanic Photoshop PrintIM RMETA Trailer XMP
  Creating tags in:
JPEG APP1 (796 bytes):
    0000: 45 78 69 66 00 00 49 49 2a 00 08 00 00 00 09 00 [Exif..II*.......]
    0010: 0f 01 02 00 06 00 00 00 7a 00 00 00 10 01 02 00 [........z.......]
    0020: 13 00 00 00 80 00 00 00 1a 01 05 00 01 00 00 00 [................]
    0030: 93 00 00 00 1b 01 05 00 01 00 00 00 9b 00 00 00 [................]
    0040: 28 01 03 00 01 00 00 00 02 00 00 00 31 01 02 00 [(...........1...]
    0050: 1c 00 00 00 a3 00 00 00 32 01 02 00 14 00 00 00 [........2.......]
    0060: bf 00 00 00 69 87 04 00 01 00 00 00 d3 00 00 00 [....i...........]
    [snip 684 bytes]
  ExifByteOrder = II
  Deleting IFD0
  Deleting APP1 EXIF segment
JPEG APP13 (15620 bytes):
    0000: 50 68 6f 74 6f 73 68 6f 70 20 33 2e 30 00 38 42 [Photoshop 3.0.8B]
    0010: 49 4d 04 04 00 00 00 00 00 86 1c 02 00 00 02 00 [IM..............]
    0020: 02 1c 02 19 00 06 41 70 75 6c 69 61 1c 02 19 00 [......Apulia....]
    0030: 05 43 69 65 6c 6f 1c 02 19 00 09 49 6f 6e 69 61 [.Cielo.....Ionia]
    0040: 6e 53 65 61 1c 02 19 00 06 49 74 61 6c 69 61 1c [nSea.....Italia.]
    0050: 02 19 00 05 49 74 61 6c 79 1c 02 19 00 0a 4d 61 [....Italy.....Ma]
    0060: 72 65 49 6f 6e 69 63 6f 1c 02 19 00 06 50 75 67 [reIonico.....Pug]
    [snip 15508 bytes]
  Deleting Photoshop
  Deleting APP13 Photoshop segment
JPEG APP2 (3158 bytes):
    0000: 49 43 43 5f 50 52 4f 46 49 4c 45 00 01 01 00 00 [ICC_PROFILE.....]
    0010: 0c 48 4c 69 6e 6f 02 10 00 00 6d 6e 74 72 52 47 [.HLino....mntrRG]
    0020: 42 20 58 59 5a 20 07 ce 00 02 00 09 00 06 00 31 [B XYZ .........1]
    0030: 00 00 61 63 73 70 4d 53 46 54 00 00 00 00 49 45 [..acspMSFT....IE]
    0040: 43 20 73 52 47 42 00 00 00 00 00 00 00 00 00 00 [C sRGB..........]
    0050: 00 00 00 00 f6 d6 00 01 00 00 00 00 d3 2d 48 50 [.............-HP]
    0060: 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [  ..............]
    [snip 3046 bytes]
  Deleting APP2 ICC_Profile segment
JPEG APP1 (9227 bytes):
    0000: 68 74 74 70 3a 2f 2f 6e 73 2e 61 64 6f 62 65 2e [http://ns.adobe.]
    0010: 63 6f 6d 2f 78 61 70 2f 31 2e 30 2f 00 3c 3f 78 [com/xap/1.0/.<?x]
    0020: 70 61 63 6b 65 74 20 62 65 67 69 6e 3d 22 ef bb [packet begin="..]
    0030: bf 22 20 69 64 3d 22 57 35 4d 30 4d 70 43 65 68 [." id="W5M0MpCeh]
    0040: 69 48 7a 72 65 53 7a 4e 54 63 7a 6b 63 39 64 22 [iHzreSzNTczkc9d"]
    0050: 3f 3e 0a 3c 78 3a 78 6d 70 6d 65 74 61 20 78 6d [?>.<x:xmpmeta xm]
    0060: 6c 6e 73 3a 78 3d 22 61 64 6f 62 65 3a 6e 73 3a [lns:x="adobe:ns:]
    [snip 9115 bytes]
  Deleting XMP
  Deleting APP1 XMP segment
JPEG APP14 (12 bytes):
    0000: 41 64 6f 62 65 00 64 40 00 00 00 01             [Adobe.d@....]
  Deleting APP14 unknown segment
JPEG DQT (130 bytes):
JPEG SOF0:
JPEG DRI (2 bytes):
JPEG DHT (416 bytes):
JPEG SOS
    1 directories scanned
    1 image files updated

Archive

[Originally posted by exiftool on 2007-10-04 15:50:21-07]

You're quite correct.  I have seriously broken the feature of being able
to exclude groups from a mass delete.  The problem is that I have greatly
expanded the number of deletable groups, and many of the groups
overlap.  I will have to look at this in detail for all groups.  Also, I added
the ability to delete arbitrary JPEG segments, which is also causing a
problem here.

Thanks for pointing this out.  I'm sorry for the inconvenience, but I will
fix this and post here when I have a pre-release available.  (It won't be
as fast as last time because I will have to re-think all of the group
interactions and do a lot more testing this time.)

It appears that not many people use this feature since you are the
first to report this problem.  So thank you very much for reporting it.

- Phil

Archive

[Originally posted by exiftool on 2007-10-04 23:32:07-07]

Well, this turned out to be a trickier problem than I thought, and a
number of compromises were necessary, but I think these changes
are good because in general now I err on the side of not deleting
enough, rather than deleting too much.

I have updated the 6.99 pre-release with the new version, and
think I have covered all the bases, but I will do some more testing
myself to be sure it works as expected under a wide variety of
conditions.  Let me know if it works OK for  you.

To give you some idea of the complications, IPTC is stored inside
the Photoshop information of a JPEG image, but is stored directly
in IFD0 of TIFF-format images, independent of the Photoshop
information.  Also, IPTC may be found in AFCP and FotoStation
trailers.

But the way ExifTool is designed, the decisions about what groups
to exclude from the deletion must be made before the file type is
known.  So when IPTC is excluded, I also exclude the Photoshop
information from the delete, which isn't technically correct for TIFF
images, but is the safe thing to do (especially since ExifTool is used
predominantly for editing JPEG's).  I don't, however, exclude the
trailers from deleting just in case they contain IPTC, because this is
a non-standard technique, and commonly used.

So some compromises were made, but I hope they were the right
ones.

And I discovered that this feature is essentially undocumented except
for a single example in the application documentation, so it is no
wonder than not many people have discovered it. Wink  So I have also
added a reference to this feature in the exiftool options documentation.

- Phil

Archive

[Originally posted by goddert on 2007-10-05 06:14:49-07]

I'm simply surprised by your efficiency Smiley I didn't even find the time to respond to your first answer.

There wasn't too much hurry having a workaround exporting and reimporting the iptc group after the general deleting of the tags. Of course a solution on the application side is the best way Smiley

Many thanks. I'll test it in the afternoon and report you any problem (if they are). I'll take also a look and the now documented feature.

Goddert

Archive

[Originally posted by goddert on 2007-10-05 14:27:25-07]

After some intensive testing I can say it's working well for me. When you say iptc is always linked to Photoshop (apart some rare cases which I can verify) your concept seems to work fine otherwise maybe there will a little problem being linked to app13 but I don't know cases where iptc lives alone and I don't know how you linked it unconditionally or only in case of jpeg and yet existing app13. Some test with Irfanview revealed that it writes the Photoshop tag too Smiley Deleting only iptc works fine. App13 remains.
 

So thank you very much.

Goddert

Archive

[Originally posted by exiftool on 2007-10-05 15:48:33-07]

Hi Goddert,

Thanks for the testing and feedback, you've been a great help!

IPTC lives alone in TIFF-format files.  I have tested these and unforunately
now, due the way the exiftool application processes the command line, it is
not possible in a single command to exclude the IPTC from deletion without
excluding Photoshop too (although technically it should be allowed).  This is
one of the compromises I was talking about, but I don't think it is worth
rewriting the command line processing just because of this.  At least now the
non-intuitive behaviour errs on the side of saftey, which is better than the
way it was before. Smiley

- Phil

Archive

[Originally posted by sergeymk on 2007-12-08 15:44:37-08]

Hi, Phil,

This seems to be the right place to report this. I am trying to remove all metadata except XMP-dc :

exiftool -all= --XMP-dc:all *.jpg

exiftool removes all tags, including XMP-dc . I wonder if the problem is similar to the one described above for IPTC.

Thank you for your time and for developing exiftool.

-Sergey

Archive

[Originally posted by exiftool on 2007-12-08 16:37:44-08]

Hi Sergey,

Hmmm.  I didn't think of this when I recently added the ability to delete
XMP namespaces.  It may be tricky to do what you want, but I will look
into adding this feature.  (After all, it does make sense.)

Thanks for pointing out this inconsistency.  I'll post  again here after
I've had a chance to look into this.

- Phil

Archive

[Originally posted by exiftool on 2007-12-08 21:21:54-08]

While I still have to address the inconsistency, I realized that
you should be able to do what you want with the current
version of exiftool using the command:

Code:
exiftool -all= -tagsfromfile @ -xmp-dc:all *.jpg

- Phil

Archive

[Originally posted by exiftool on 2008-02-29 17:21:35-08]

Sorry for the delay, but as of ExifTool 7.19, you can exclude
XMP family 1 groups from deletion.

- Phil