Errata

Programming Web Graphics with Perl and GNU Softwar

Errata for Programming Web Graphics with Perl and GNU Softwar

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
, PDF, ePub, Page 2rand[0,1,1]
New York

VNhxsB http://www.FyLitCl7Pf7kjQdDUOLQOuaxTXbj5iNG.com

Bradley  Aug 07, 2015 
Printed Page 18
in the header block

The paragraph reads:

The header is 13 bytes in length, consisting of the
following fields:

The following field descriptions total only 12 bytes.

Does the Global Color Table still start at byte 14? You should also indicate
if you are zero-based (i.e., byte 14 or 14th byte).

Anonymous   
Printed Page 39
Apparently, there is some problem with the Active State port of Perl and

named parameters using the CGI.pm module. An example:

print $query -> header(-type => 'image/png',
-expires => '1d'); # remove from cache tomorrow.

must instead use an anonymous hash as in
print $query -> header({'type' => 'image/png',
'expires' => '1d'}); # remove from cache tomorrow.

Anonymous   
Printed Page 79
paragraph 2

The author says that GD perl module is now independent of the gd library. Per
email with the author of the PM module, this is no longer true. You must have
gd installed in order to compile the GD perl module.


Anonymous   
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 Transform() method is described here, but in more recent verisons of
ImageMagick and PerlMagick the method has been deprecated in favour of the
Resize() method.

Transform does not raise an exception but it doesn't do anything either.

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
The counter.pl script doesn't work. I get a Segmentation Fault whenever

I try running it. I've ran it using a RH5.2 Linux with perl 5.004_05 and on a
System V 4.0 with perl 5.005_3. I even copied it and BrokenImage.pm directly
from your web site here and ran it, and it still won't go. The image files
(0.gif..9.gif) are in a directory named "default." The countfile is
countfile.txt layed out as described in the book (current count followed on
the next line with allowed hosts).

Anonymous   
Printed Page 291
counter.pl

I was also unable to get the counter.pl script to function. I created the
BrokenImage.pm file which seems to work correctly. I get errors reading:

Can't call method "getBounds" without a package or object reference at
/web/cgi-bin/counter/counter.pl line 88.

This is on the HP-UX platform running Apache.

Anonymous   
Printed Page 291
counter.pl

The counter.pl program as written in the book does not function correctly. A
way to make this function is to comment out the "use strict;" line and change
the "$d = newFromGif GD::Image(*DIGIT);" to "$d = newFromGif
GD::Image(DIGIT);" (remove the *).

Upon doing this the script will function correctly without the strict module.
Removing the * and leaving the strict module throws an error stating that
DIGIT is not alowed when using the strict module.

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