| Printed |
Page 119
first paragraph |
This is not actually a technical mistake, but is very serious and important to
the chapter. The locaiton of ImageMagick has changed.
You can now download the source from:
ftp://ftp.simplesystems.org/pub/ImageMagick/.
The new version is incompatible with two verisons of the FreeType library and,
strangely, the older versions of ImageMagick seem to be incompatible with
newer versions of FreeType as well.
I had problems installing the perl module from CPAN, and I believe the CPAN
module may not be up-to-date with the module provided in ImageMagick. The Perl
module shoud be installed from the source distribution. In addition, despite
my intention in configuration, the config script seemed to have not defaulted
to --with-perl as it says it will, or, if it did, the flag was ignored.
After some fiddling I was able to get everything to install properly (I
skipped a number of the less useful filetypes' supports, so there may or may
not have been other issues that I avoided).
After the upgrade, many scripts stopped working properly. A number of methods
aren't the same.
|
Anonymous |
| Printed |
Page 162
2nd header |
The new parameters for the Annotate() method are as follows:
text=>string, font=>string, pointsize=>integer, density=>geometry,
stroke=>color name, stroke_width=>integer, fill=>color name, box=>color name,
geometry=>geometry, gravity=>{NorthWest, North, NorthEast, West, Center, East,
SouthWest, South, SouthEast}, antialias=>{true, false}, x=>integer,
y=>integer, translate=>float, float, scale=>float, float, rotate=>float,
skewX=>float, skewY=>float
The font specification seems to require an absolute path, at least for
TrueType fonts, as opposed to looking for them in the location specified in
--with-font-path=x as specified during configuration of the makefile. For
instance, font=>"@/usr/local/fonts/COUR.TTF," not just "@COUR.TTF."
The pen parameter has been apparently deprecated, replaced by stroke and fill.
This also breaks scripts relying on older Annotate() parameters, as it will
simply draw in black (and when doing so on black, you cannot see the
"changes").
The new gravity parameter also makes a difference. You specify the start or
end point of the center of the annotation with this.
I was unable to get Image::Magick to open an HTML file as I was able to do
before, and I have Ghostscript properly configured. In addition, while opening
a text file was possible, the page was blank.
Note that these changes are not properly documented anywhere. On the new site
for ImageMagick (http://www.simplesystems.org/ImageMagick/www/perl.html) I was
unable to locate an actual changelog documenting the API modifications -- the
changes seem to have been made without warning. Further, there is no longer
good documentation on exactly how specific methods and their properties work
anymore -- and with a slew of new or changed properties and methods, this is
frustrating to say the least.
If an updated edition of PWGWPAGS is not in order, at least a full online
description of the changes at O'Reilly should be available, or else many
would-be web graphics developers will purchase inaccurate information from ORA.
Please note: it also seems to be impossible to install and properly configure
an older version of Image::Magick with a newer FreeType library and get the
new FreeType recognized.
|
Anonymous |
| Printed |
Page 291
another correction to counter.pl |
To get the counter.pl script running while using the strict module, you simply
need to change the following line:
$d = newFromGif GD::Image(*DIGIT);
Change the end of the line to match the following:
$d = newFromGif GD::Image("DIGIT");
You will also want to do some checking for defined variables throughout the
program to get rid of a few other warnings. For example, I changed the
following lines:
my $count = 0;
flock COUNT, LOCK_EX;
$count = <COUNT>;
my $users = <COUNT>;
chop($users);
to:
flock COUNT, LOCK_EX;
my $count = <COUNT>;
$count = 0 unless(defined($count));
my $users = <COUNT>;
$users = '' unless(defined($users));
chop($users);
Other minor changes like this can make the code error free and fully
functional. These changes here should do the trick. Check your error log files
if there is something amiss.
|
Anonymous |