Graphics::Magick is now the standard graphics package in WebGUI, but

Image::Magick will be supported for backwards compatibility. See gotcha.txt
   for details.
This commit is contained in:
JT Smith 2007-07-26 03:23:47 +00:00
parent 168ba28ccf
commit bde1a7a941
6 changed files with 55 additions and 10 deletions

View file

@ -1,8 +1,23 @@
package WebGUI::Image;
use strict;
use Image::Magick;
use WebGUI::Image::Palette;
use Carp qw(croak);
eval 'use Graphics::Magick';
my $graphicsMagickAvailable = ($@) ? 0 : 1;
eval 'use Image::Magick';
my $imageMagickAvailable = ($@) ? 0 : 1;
my $graphicsPackage = '';
if ($imageMagickAvailable) {
$graphicsPackage = "Image::Magick";
}
elsif ($graphicsMagickAvailable) {
$graphicsPackage = "Graphics::Magick";
}
else {
croak "You must have either Graphics::Magick or Image::Magick installed to run WebGUI.\n";
}
=head1 NAME
@ -173,7 +188,7 @@ sub new {
my $width = shift || 300;
my $height = shift || 300;
my $img = Image::Magick->new(
my $img = $graphicsPackage->new(
size => $width.'x'.$height,
);