Image-ExifTool - Re: IPTC XMP EXIF Clearing and Writing issues

Posted on Tue Oct 24 15:22:34 2006 by exiftool in response to 3311 (See the whole thread of 2)
Re: IPTC XMP EXIF Clearing and Writing issues
(Gotta watch using that back button in the browser-- you posted your message 4 times. :P)

What you are doing will work. Well, it should work, and it does work for me. (You _are_ using ExifTool 6.40 or later, right?)

ExifTool will add back the necessary "spots" in the file to write the specified information. One thing though: Your calls to SetNewGroups() have no effect because you are providing a specific group for writing the information. The SetNewGroups() only sets the default group priorities if you call SetNewValue() with a group-less tag.

I just tried this code snippet here, and it works fine:

$exifTool->SetNewValue('iptc:all' => undef); $exifTool->SetNewValue('xmp:all' => undef); $exifTool->SetNewValue('exif:all' => undef); $exifTool->SetNewValue('iptc:objectname' => 'test data'); $exifTool->WriteInfo('src.jpg', 'dst.jpg');

Note that you must be using ExifTool 6.40 or later for this to work, since in earlier versions the delete operation always took precedence, and this type of operation would have to be performed in two steps.

Your calls to SetNewValue('EXIF:all' => ''), etc won't work, because this would attempt to write all EXIF tags with an empty value, which is very different from deleting the tags.

- Phil
Write a response