Programming Web Graphics with Perl & GNU Software by Shawn P. Wallace This errata page lists errors outstanding in the most recent printing. If you have any error reports or technical questions, you can send them to booktech@oreilly.com. (Please specify the printing date of your copy.) This page was updated on September 13, 1999. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification Confirmed errors: (xii) Booktech e-mail: missing ".com" {xiii} Paragraph 4 of the Acknowledgments reads: Bob Freishanham It should read: Bob Friesenhahn (14-15) Figures 1-5 and 1-6: the captions should note that the PNGs for which file sizes are given are 24-bit images; they would be comparable to or smaller than the GIFs if saved as 8-bit indexed images (e.g., use gif2png to convert and optionally pngcrush to optimize) {46} binmode(STDIN); should be binmode(INFILE); {48} Change if ((length($text) > 20 | ($text =~ / /) ) { to if ((length($text) > 20 || ($text =~ / /) ) { {53} The line at the top of the page reading: $filesize = $filesize / 1000; Should read: $filesize = $filesize / 1024; (58) In comment line starting "# The right ear: ...." should be the upper left and lower right (not left) (65) In the references section, the URL for the Perl-Apache Integration Project should be http://perl.apache.org (71) libjpeg platforms: should be "Most"; also, "IPG" should be "IJG" (74) zlib platforms: should be "Most" (82) Mentions that If you are working on a platform that makes a distinction between text and binary files (such as Windows 95/NT), be sure that you are writing in binary mode by calling the binmode() method first." But on page 96 it reads On Unix systems, you can pipe the image data to an image viewer, such as xv or the display utility that comes with ImageMagick. Yet in the example that soon follows is the binmode statement advised for Windows 95/NT systems. On a UNIX system it doesn't matter whether the filehandle is in binary mode or not. It won't hurt anything, but it doesn't do anything either. Remove from future printings. (99) "allocateColor" should be "colorAllocate." This error occurs twice, in 2. and 3. of the "setBrush()" section (99) On line 4. Change: ($whitest) to ($mostestwhitest) {100} 3rd last line. 'INFILE' should read \*INFILE {111} $image->rectangle(@boundingbox, red); should be $image->rectangle(@boundingbox, $red); (117) Table 5-1, line 1: "GraphDics": delete D (117)Table 5-1, last line: "Multiple" should be "Multiple-image" {128} Under 'base_rows, base_filename' should be 'base_rows' {129} Under colormap[i], 'set' should be 'Set'. (321) Two times it lists \Times-Roman instead of /Times-Roman. (336) Under the font heading on the last line it says... corresponds with the set of default Ghostscript fonts with have AFM files: Should say corresponds with the set of default Ghostscript fonts with AFM files: (337) The first line reads currently fonts currently supported by PostScript::Metrics Should be fonts currently supported by PostScript::Metrics (353) Under linetint and filltint it reads with 1 as black and 0 as white. It should be with 1 as white and 0 as black (340) Two Bugs in the PostScript::TextBlock module in two areas in the Write() subroutine of the TextBlock module that required a patch. They both have to do with proper word wrapping. One problem was that words would not always line up against the left margin due to white space that remained attached to the font of a word when we'd gone over the limit and the word had to be pushed back for later processing. In this case, we would want to remove the leading white space. Below is the updated version of the code section that covers this. # If we've gone over, push the word back on # for later processing. # if ( ($wcount>$w) || ($word =~ s/\n//) ) { if ($word =~ /^ /) { $word =~ s/^[ ]+//; } # This line is the patch unshift @words, $word; last LINE; } The other problem had to do with the section of code that determined if there were any remaining words that needed to be put back for later processing. The existing code does the logical check: if ($#words) { $element->{text} = join '', @words; } but "$#words" returns the subscript of the last element in @words, NOT the number of elements. Instead, use the code: my $numWords = @words; if ($numWords) { $element->{text} = join '', @words; }