Changing tags in Perl with ExifTool

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

Previous topic - Next topic

Archive

[Originally posted by jym on 2008-08-04 16:24:08-07]

I don't know how to change fields in exif data of a JPEG file.
Here is a simple code:

use Image::ExifTool ':Public';
my $exifTool = new Image::ExifTool;
my $file = shift or die "Please specify filename";
$info=ImageInfo($file);
SetNewValue($info{Flash},'new value');
$fout='new_'.$file;
$y = WriteInfo($file,$fout);

(I have suppressed the "non authorized characters" before the calls to imageinfo setnewvalue and writeinfo)
I perfectly read the Exif tag "Flash" but I can't change it to 'new value'!
What is missing ?
TIA.

Archive

[Originally posted by jym on 2008-08-05 08:13:20-07]

I first tried :  

SetNewValue('Flash','new value');  

But I get a message :  
Can't convert ExifIFD:Flash (not in PrintConv)  

'Flash' is a known tag in exif.

My mistake is probably stupid but I can't find it !

Thanks for your help

Archive

[Originally posted by exiftool on 2008-08-15 11:21:27-07]

you have to set the Flash tag to a valid value
(ie. "Fired, Return not detected").  See the
https://exiftool.org/TagNames/EXIF.html" target="_blank">EXIF
tag name documentation for a complete list
of valid values.

 - Phil

Archive

[Originally posted by jym on 2008-08-16 14:22:38-07]

Thanks Phil, I did not realize that Exif data were stricly defined. I used the IPTC tags to store my own text tags.