Subject: | Dr. Watson/GPF when accessing TIFF images on WinXP |
Whenever I try to read a TIFF image using Imager, Dr. Watson pays me a visit (ie, the program GPFs). I am using Windows XP Professional, ActiveState Perl 5.6.1.633, and a PPD of Imager version 0.41.
All I am trying to do is deliver a multi-page TIFF to a client browser. I'm not sure if this code is correct, but seeing as how I can't even read the image it's difficult to work with ;) If I use a JPEG instead of a TIFF in the first block of code below, it works great. If I could get TIFF to work, I'd be in hog heaven.
The code I have tried thus far includes:
my $file = 'd:\test.tif';
my $img = Imager->new();
$img->open(file=>$file) or die $img->errstr(); # This line crashes
binmode STDOUT;
print $request->header(-type=>'image/tiff');
$img->write(type=>'tiff', fd=>fileno(STDOUT)) or die $img->errstr();
# First line crashes
my @images = Imager->read_multi(file=>$file,type=>'tiff');
binmode STDOUT;
print $request->header(-type=>'image/tiff');
Imager->write_multi({fd=>fileno(STDOUT),type=>'tiff'}, @images);
I have provided a sample image at http://www.devnetinc.com/~crome/test.TIF.