The deprecated use of Graphics::Magick has been eliminated. WebGUI uses

Image::Magick exclusively for all image processing functions once again.
This commit is contained in:
JT Smith 2008-11-26 16:59:25 +00:00
parent a8952dc886
commit 04f2388ef8
4 changed files with 15 additions and 39 deletions

View file

@ -1,8 +1,8 @@
7.6.5
- fixed #8800: Errors in POD of Asset-related mix-in modules (Bernd Kalbfuß-Zimmermann)
- fixed: Products imported into the Shelf have bad URLs
- Deprecated WebGUI::Storage::Image. WebGUI::Storage can now do everything
WebGUI::Storage::Image can do.
- Deprecated WebGUI::Storage::Image. WebGUI::Storage can now do everything WebGUI::Storage::Image can do.
- The deprecated use of Graphics::Magick has been eliminated. WebGUI uses Image::Magick exclusively for all image processing functions once again.
- fixed: #9147: Misspellings in Account
- fixed: #9148: Account: account links do not work
- fixed: #9149: Account: default templates do not work right

View file

@ -7,6 +7,12 @@ upgrading from one version to the next, or even between multiple
versions. Be sure to heed the warnings contained herein as they will
save you many hours of grief.
7.6.5
--------------------------------------------------------------------
* The deprecated use of Graphics::Magick has been eliminated. WebGUI uses
Image::Magick exclusively for all image processing functions once again.
7.6.4
--------------------------------------------------------------------
* The user facing portions of WebGUI's profile, inbox, friends, and "invite

View file

@ -2,20 +2,7 @@ package WebGUI::Image;
use strict;
use WebGUI::Image::Palette;
use Carp qw(croak);
our $graphicsPackage;
BEGIN {
if (eval { require Graphics::Magick; 1 }) {
$graphicsPackage = 'Graphics::Magick';
}
elsif (eval { require Image::Magick; 1 }) {
$graphicsPackage = 'Image::Magick';
}
else {
croak "You must have either Graphics::Magick or Image::Magick installed to run WebGUI.\n";
}
}
use Image::Magick;
=head1 NAME
@ -186,7 +173,7 @@ sub new {
my $width = shift || 300;
my $height = shift || 300;
my $img = $graphicsPackage->new(
my $img = Image::Magick->new(
size => $width.'x'.$height,
);
@ -263,13 +250,7 @@ The height of the image in pixels.
sub setImageHeight {
my $self = shift;
my $height = shift;
if ($graphicsPackage eq 'Graphics::Magick') {
$self->image->Resize(height => $height);
}
else {
$self->image->Extent(height => $height);
}
$self->image->Extent(height => $height);
$self->image->Colorize(fill => $self->getBackgroundColor);
$self->{_properties}->{height} = $height;
}
@ -289,12 +270,7 @@ Teh width of the image in pixels.
sub setImageWidth {
my $self = shift;
my $width = shift;
if ($graphicsPackage eq 'Graphics::Magick') {
$self->image->Resize(width => $width);
}
else {
$self->image->Extent(width => $width);
}
$self->image->Extent(width => $width);
$self->image->Colorize(fill => $self->getBackgroundColor);
$self->{_properties}->{width} = $width;
}
@ -417,13 +393,7 @@ sub text {
my $anchorX = $properties{x};
my $anchorY = $properties{y};
my %testProperties = %properties;
delete $testProperties{align};
delete $testProperties{style};
delete $testProperties{fill};
delete $testProperties{alignHorizontal};
delete $testProperties{alignVertical};
my ($x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance) = $self->image->QueryFontMetrics(%testProperties);
my ($x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance) = $self->image->QueryMultilineFontMetrics(%properties);
# Process horizontal alignment
if ($properties{alignHorizontal} eq 'center') {

View file

@ -422,8 +422,8 @@ sub getLabelDimensions {
my ($x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance) = $self->image->QueryFontMetrics(
font => $self->getLabelFont->getFile,
# stroke => $self->getLabelColor,
# fill => $self->getLabelColor,
# style => 'Normal',
fill => $self->getLabelColor,
style => 'Normal',
pointsize => $self->getLabelFontSize,
%$properties,
text => $text,