Subject: | Exif data not written for jpegs |
Writing exif data for a jpeg does not seem to work. In memory, you can settag/addtag and
then the appropriate value will be displayed by tags(), but if you write the file the tag seems
to get lost.
I have tried this on OS/X and Archlinux with the same results. The attached test file fails the
second test.
On my linux box I have:
Imager 0.77
perl 5.12.1
libjpeg 8.0.2
BTW, thanks to all involved in writing/maintaining this module. It is by far my favorite perl
image module.
-Mark
Subject: | im-tag.pl |
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Imager;
my $img = Imager->new;
$img->read( file => 'test.jpg' ) or die;
my $tag_value = 'Test Value';
$img->settag( name => 'exif_model', value => $tag_value ) or die;
is( $img->tags( name=>'exif_model'), $tag_value, 'exif data in memory' );
my $jpg;
$img->write( data => \$jpg, type => 'jpeg' ) or die $img->errstr;
my $im2 = Imager->new;
$im2->read( data => $jpg ) or die $im2->errstr;
is( $im2->tags( name=>'exif_model'), $tag_value, '... read after write' );