Image-ExifTool - Re: perl syntax to inject external XMP data into image files?

Posted on Thu Apr 24 20:29:35 2008 by exiftool in response to 7756 (See the whole thread of 5)
Re: perl syntax to inject external XMP data into image files?
Hi Erik,

Your script will copy the tags individually from the XMP file, but the command line set the value of the "XMP" tag from the data of the file. ie)

my $exif = Image::ExifTool->new(); my $data; open FILE, $xmpfn or die; read FILE, $data, 1000000 or die; close FILE; $exif->SetNewValue( 'XMP', $data ); $exif->WriteInfo( $fn );

Of course, this code imposes an arbitrary restriction of 1000000 bytes on the size of the XMP file -- this was done just to simplify the example.

- Phil
Direct Responses: 7758 | 7763 | Write a response