Subject: | Error recognizing JPG File in GD::Image->new($filename) |
Date: | Wed, 9 Apr 2008 12:38:39 -0700 |
To: | <bug-GD [...] rt.cpan.org> |
From: | "Bill Rose" <bill [...] ewalk.com> |
Attached JPG opens fine in just about any photo viewing program, but GD
doesn't recognize the file as a JPG. If I force GD by using
GD::Image->newFromJpeg, then it seems to open ok.
I'm actually using Image::Resize, but it just calls GD::Image->new which was
returning undef, so Image::Resize was dieing.
$orig_file = "<attached JPG to this email>";
My original code:
use Image::Resize;
my $image = Image::Resize->new($orig_file); #<--- This was dieing, as it
calls GD::Image->new which returns undef
My updated code:
use Image::Resize;
my $mygd = GD::Image->newFromJpeg($orig_file, 1);
my $image = Image::Resize->new($mygd);
Thanks,
-Bill
Message body is not shown because sender requested not to inline it.