Subject: | Trouble updating attributes in JPG from a Canon Rebel XT |
I am having the following problem with 4.93 on both a Mac OS-X 10.3 box (using perl v5.8.1-RC3 as supplied by Apple) and on a PC with Windows XP-SP2 box (using Activeperl 5.8.6, binary build 811).
I've recently purchased a Canon Rebel XT (aka Rebel 350D) camera (a very new model, just shipping in quantity in March) and am having trouble setting some attributes. Exiftool has no problem reading the attributes and jhead and acdsee can both set attributes.
The following example illustrates the problem:
fwp1@jester$ exiftool -Country="USA" rebelxt.jpg
1 image files updated
fwp1@jester$ exiftool -Copyright="Frank Peters" rebelxt.jpg
Error: Error reading ThumbnailImage data in IFD1 - rebelxt.jpg
0 image files updated
1 files weren't updated due to errors
fwp1@jester$ exiftool -b -ThumbnailImage rebelxt.jpg > rebelxt-thumb.jpg
fwp1@jester$ ls -l rebelxt-thumb.jpg
-rw-r--r-- 1 fwp1 wheel 8396 6 Apr 09:34 rebelxt-thumb.jpg
Notice that attempting to update the copyright tag fails with an error about reading the thumbnail, yet I can successfully extract the thumbnail from the same file (and the extracted thumbnail looks fine in an imageviewer). Also notice that I can update the country tag. The same problem also occurs when setting the Artist and UserComment attributes.
This error occurs with a little more than half of the pictures I have taken with this camera. I've used it with pictures from my older Canon G3 with no problems.
The attached script illustrates that the problem also occurs with a very simple script that uses
the library.
The image used in these examples is available on the web at
http://www2.msstate.edu/~fwp1/rebelxt.jpg
(Be warned, this is a 5MB file...every tool I use to reduce its size also makes the problem go
away).
Please let me know if I can provide further information.
#!/usr/bin/perl -w
# Global defines
#my $basePath = "c:\\Documents and Settings\\fwp1\\My Documents\\My Pictures";
my $basePath = "/tmp";
my $origInfo;
use Image::ExifTool;
my $exifTool = new Image::ExifTool;
$exifTool->Options( DateFormat => '%Y %m %d %H %M %S %B');
while ($origFile = shift) {
my $origInfo = $exifTool->ImageInfo($origFile, 'datetimeoriginal');
# $exifTool->SetNewValue('Copyright', 'Frank Peters <fwp@fwpeters.us');
$exifTool->SetNewValue('Country', 'USA');
$newFile = "new-${origFile}";
print "$origFile -> $newFile\n";
$exifTool->WriteInfo($origFile, $newFile) || die "Couldn't write file: " . $exifTool->GetValue('Error') . "\n";
$exifTool->SetNewValue();
}