J
jwcarlton
Is it possible to convert an image from GIF to JPG using the Imager
module, or am I going to have to switch over to Image::Magick?
Currently, converting PNG or BMP is working fine, it's just a GIF that
gives me an error. Here's the code I'm using:
($filename, $ext) = $pic =~ m/(.*)\.(.*)/;
my $image = Imager->new;
$image->read(file => "$path/$pic");
$image->write(file => "$path/$filename.jpg")) or
die $image->errstr;
When I upload a GIF, I get an error on the "write(file => ...)" line
that says "Can't call method "write" on an undefined value".
This is the same if I change the line to:
$image->write(file => "$path/$pic")) or
die $image->errstr;
Which doesn't actually convert anything, but I still get an error when
writing.
TIA,
Jason
module, or am I going to have to switch over to Image::Magick?
Currently, converting PNG or BMP is working fine, it's just a GIF that
gives me an error. Here's the code I'm using:
($filename, $ext) = $pic =~ m/(.*)\.(.*)/;
my $image = Imager->new;
$image->read(file => "$path/$pic");
$image->write(file => "$path/$filename.jpg")) or
die $image->errstr;
When I upload a GIF, I get an error on the "write(file => ...)" line
that says "Can't call method "write" on an undefined value".
This is the same if I change the line to:
$image->write(file => "$path/$pic")) or
die $image->errstr;
Which doesn't actually convert anything, but I still get an error when
writing.
TIA,
Jason