I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2006-10-24 00:14:08-07 by 00coday
IPTC XMP EXIF Clearing and Writing issues
I am trying to clear all IPTC/XMP/EXIF data from an image and write in only the information I want. I am using the following to clear the metadata
$exifTool->SetNewGroups('XMP'); $exifTool->SetNewValue('XMP:all' => undef); $exifTool->SetNewGroups('IPTC'); $exifTool->SetNewValue('IPTC:all' => undef); $exifTool->SetNewGroups('EXIF'); $exifTool->SetNewValue('EXIF:all' => undef); $update=$exifTool-> WriteInfo("$basedir\\@record[1].jpg","$basedir\\@record[1]x.jpg");

and it works great. I then rename the file back to the original. The problem comes when I try to write back to the file. I am using:
$exifTool-> SetNewGroups('IPTC'); $exifTool-> SetNewValue('IPTC:ObjectName' => 'test data'); $update=$exifTool-> WriteInfo("$basedir\\$record[1].jpg","$basedir\\$record[1]x.jpg",'IPTC');

Neither perl or ExifTool report an error, but no data is written to the file. I am assuming that clearing the data the way I am will actually remove the spots in the file where it is supposed to reside, so there is nowhere to write to. I tried using the following:
$exifTool->SetNewGroups('XMP'); $exifTool->SetNewValue('XMP:all' => ''); $exifTool->SetNewGroups('IPTC'); $exifTool->SetNewValue('IPTC:all' => ''); $exifTool->SetNewGroups('EXIF'); $exifTool->SetNewValue('EXIF:all' => ''); $update=$exifTool->WriteInfo("$basedir\\@record[1].jpg","$basedir\\@record[1]x.jpg");

but I get a "Can't set value for all tags" error which comes from the date fields. Any thoughts on how to quickly clear all IPTC-XMP-EXIF fields without having to do them one by one and still be able to write to the resulting file?
Direct Responses: Write a response