From 67d441b2217e8c5831cba1c344146683fa07a0ba Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Mon, 21 Feb 2011 21:11:00 +1100 Subject: [PATCH] [RT #65749] add pod link check test and fix the broken links --- Imager.pm | 241 +++++++++++++++++---------------- lib/Imager/Draw.pod | 50 +++---- lib/Imager/Engines.pod | 4 +- lib/Imager/Files.pod | 23 ++-- lib/Imager/Filters.pod | 50 +++---- lib/Imager/Font.pm | 16 +-- lib/Imager/Handy.pod | 2 +- lib/Imager/ImageTypes.pod | 14 +- lib/Imager/Transformations.pod | 14 +- t/x20spell.t | 2 +- t/x30podlinkcheck.t | 134 ++++++++++++++++++ 11 files changed, 345 insertions(+), 205 deletions(-) create mode 100644 t/x30podlinkcheck.t diff --git a/Imager.pm b/Imager.pm index e1039a0c..1b207129 100644 --- a/Imager.pm +++ b/Imager.pm @@ -4199,7 +4199,7 @@ the C method to find out why: =over -=item C +=item errstr() Returns the last error message in that context. @@ -4227,209 +4227,210 @@ L. Where to find information on methods for Imager class objects. -addcolors() - L - add colors to a +addcolors() - L - add colors to a paletted image -addtag() - L - add image tags +addtag() - L - add image tags -align_string() - L - draw text aligned on a +align_string() - L - draw text aligned on a point -arc() - L - draw a filled arc +arc() - L - draw a filled arc -bits() - L - number of bits per sample for the +bits() - L - number of bits per sample for the image -box() - L - draw a filled or outline box. +box() - L - draw a filled or outline box. -circle() - L - draw a filled circle +circle() - L - draw a filled circle -colorcount() - L - the number of colors in an -image's palette (paletted images only) +colorcount() - L - the number of +colors in an image's palette (paletted images only) -combine() - L - combine channels from one or -more images. +combine() - L - combine channels +from one or more images. -combines() - L - return a list of the different -combine type keywords +combines() - L - return a list of the +different combine type keywords -compose() - L - compose one image +compose() - L - compose one image over another. convert() - L - transform the color space -copy() - L - make a duplicate of an +copy() - L - make a duplicate of an image -crop() - L - extract part of an image +crop() - L - extract part of an image -def_guess_type() - L - default function +def_guess_type() - L - default function used to guess the output file format based on the output file name -deltag() - L - delete image tags +deltag() - L - delete image tags difference() - L - produce a difference images from two input images. -errstr() - L<"Basic Overview"> - the error from the last failed +errstr() - L - the error from the last failed operation. filter() - L - image filtering -findcolor() - L - search the image +findcolor() - L - search the image palette, if it has one -flip() - L - flip an image, vertically, +flip() - L - flip an image, vertically, horizontally -flood_fill() - L - fill an enclosed or same +flood_fill() - L - fill an enclosed or same color area -getchannels() - L - the number of +getchannels() - L - the number of samples per pixel for an image -getcolorcount() - L - the number of +getcolorcount() - L - the number of different colors used by an image (works for direct color images) -getcolors() - L - get colors from the image +getcolors() - L - get colors from the image palette, if it has one -getcolorusage() - L +getcolorusage() - L -getcolorusagehash() - L +getcolorusagehash() - L get_file_limits() - L -getheight() - L - height of the image in +getheight() - L - height of the image in pixels -getmask() - L - write mask for the image +getmask() - L - write mask for the image -getpixel() - L - retrieve one or more pixel +getpixel() - L - retrieve one or more pixel colors -getsamples() - L - retrieve samples from a +getsamples() - L - retrieve samples from a row or partial row of pixels. -getscanline() - L - retrieve colors for a +getscanline() - L - retrieve colors for a row or partial row of pixels. -getwidth() - L - width of the image in +getwidth() - L - width of the image in pixels. -img_set() - L - re-use an Imager object +img_set() - L - re-use an Imager object for a new image. -init() - L +init() - L -is_bilevel() - L - returns whether +is_bilevel() - L - returns whether image write functions should write the image in their bilevel (blank and white, no gray levels) format -line() - L - draw an interval +line() - L - draw an interval -load_plugin() - L +load_plugin() - L map() - L - remap color channel values -masked() - L - make a masked image +masked() - L - make a masked image -matrix_transform() - L +matrix_transform() - L -maxcolors() - L +maxcolors() - L -NC() - L +NC() - L -NCF() - L +NCF() - L -new() - L +new() - L -newcolor() - L +newcolor() - L -newcolour() - L +newcolour() - L -newfont() - L +newfont() - L -NF() - L +NF() - L open() - L - an alias for read() =for stopwords IPTC -parseiptc() - L - parse IPTC data from a JPEG +parseiptc() - L - parse IPTC data from a JPEG image -paste() - L - draw an image onto an image +paste() - L - draw an image onto an +image -polygon() - L +polygon() - L -polyline() - L +polyline() - L -preload() - L +preload() - L read() - L - read a single image from an image file read_multi() - L - read multiple images from an image file -read_types() - L - list image types Imager +read_types() - L - list image types Imager can read. -register_filter() - L +register_filter() - L -register_reader() - L +register_reader() - L -register_writer() - L +register_writer() - L -rotate() - L +rotate() - L -rubthrough() - L - draw an image onto an -image and use the alpha channel +rubthrough() - L - draw an image +onto an image and use the alpha channel -scale() - L +scale() - L -scale_calculate() - L +scale_calculate() - L -scaleX() - L +scaleX() - L -scaleY() - L +scaleY() - L -setcolors() - L - set palette colors in -a paletted image +setcolors() - L - set palette colors +in a paletted image set_file_limits() - L -setmask() - L +setmask() - L -setpixel() - L +setpixel() - L -setsamples() - L +setsamples() - L -setscanline() - L +setscanline() - L -settag() - L +settag() - L -string() - L - draw text on an image +string() - L - draw text on an image -tags() - L - fetch image tags +tags() - L - fetch image tags -to_paletted() - L +to_paletted() - L -to_rgb16() - L +to_rgb16() - L -to_rgb8() - L +to_rgb8() - L -transform() - L +transform() - L -transform2() - L +transform2() - L -type() - L - type of image (direct vs paletted) +type() - L - type of image (direct vs paletted) -unload_plugin() - L +unload_plugin() - L -virtual() - L - whether the image has it's own +virtual() - L - whether the image has it's own data write() - L - write an image to a file @@ -4437,26 +4438,26 @@ write() - L - write an image to a file write_multi() - L - write multiple image to an image file. -write_types() - L - list image types Imager +write_types() - L - list image types Imager can write. =head1 CONCEPT INDEX animated GIF - L -aspect ratio - L, -L, L +aspect ratio - C, C, C in +L. blend - alpha blending one image onto another -L +L -blur - L, L +blur - L, L -boxes, drawing - L +boxes, drawing - L changes between image - L -channels, combine into one image - L +channels, combine into one image - L color - L @@ -4470,22 +4471,22 @@ contrast - L, L convolution - L -cropping - L +cropping - L CUR files - L C images - L -dpi - L, +dpi - C, C in L, L -drawing boxes - L +drawing boxes - L -drawing lines - L +drawing lines - L -drawing text - L, L +drawing text - L, L -error message - L<"ERROR HANDLING"> +error message - L files, font - L @@ -4493,18 +4494,18 @@ files, image - L filling, types of fill - L -filling, boxes - L +filling, boxes - L -filling, flood fill - L +filling, flood fill - L -flood fill - L +flood fill - L fonts - L -fonts, drawing with - L, -L, L +fonts, drawing with - L, +L, L -fonts, metrics - L, L +fonts, metrics - L, L fonts, multiple master - L @@ -4514,15 +4515,15 @@ L GIF files - L -GIF files, animated - L +GIF files, animated - L gradient fill - L, L, L, L -gray scale, convert image to - L +gray scale, convert image to - L -guassian blur - L +gaussian blur - L hatch fills - L @@ -4535,11 +4536,11 @@ JPEG - L limiting image sizes - L -lines, drawing - L +lines, drawing - L matrix - L, -L, -L +L, +L metadata, image - L @@ -4550,11 +4551,11 @@ noise, filter - L noise, rendered - L, L -paste - L, -L +paste - L, +L -pseudo-color image - L, -L +pseudo-color image - L, +L =for stopwords posterize @@ -4564,34 +4565,34 @@ PNG files - L, L PNM - L -rectangles, drawing - L +rectangles, drawing - L -resizing an image - L, -L +resizing an image - L, +L RGB (SGI) files - L saving an image - L -scaling - L +scaling - L SGI files - L sharpen - L, L -size, image - L, -L +size, image - L, +L -size, text - L +size, text - L tags, image metadata - L -text, drawing - L, L, +text, drawing - L, L, L text, wrapping text in an area - L -text, measuring - L, L +text, measuring - L, L tiles, color - L diff --git a/lib/Imager/Draw.pod b/lib/Imager/Draw.pod index 41389680..29eb9b70 100644 --- a/lib/Imager/Draw.pod +++ b/lib/Imager/Draw.pod @@ -125,7 +125,7 @@ L for more information. =over -=item line +=item line() $img->line(color=>$green, x1=>10, x2=>100, y1=>20, y2=>50, aa=>1, endp=>1 ); @@ -150,7 +150,7 @@ C, C - end point of the line. Required. =item * -C - the color of the line. See L<"Color Parameters">. Default: +C - the color of the line. See L. Default: black. =item * @@ -165,7 +165,7 @@ C - if true the line is drawn anti-aliased. Default: 0. =back -=item polyline(points => [ [ x, y ], [ x, y ], ... ], color => color) +=item polyline() $img->polyline(points=>[[$x0,$y0],[$x1,$y1],[$x2,$y2]],color=>$red); $img->polyline(x=>[$x0,$x1,$x2], y=>[$y0,$y1,$y2], aa=>1); @@ -200,7 +200,7 @@ to supplying the C parameter. =item * -C - the color of the line. See L<"Color Parameters">. +C - the color of the line. See L. Default: black. =item * @@ -210,7 +210,7 @@ be supplied as C for backward compatibility. =back -=item box +=item box() $blue = Imager::Color->new( 0, 0, 255 ); $img->box(color => $blue, xmin=>10, ymin=>30, xmax=>200, ymax=>300, @@ -265,7 +265,7 @@ C, C and overrides their values. =item * -C - the color of the line. See L<"Color Parameters">. +C - the color of the line. See L. Default: white. This is ignored if the filled parameter =item * @@ -276,11 +276,11 @@ outlined. Default: an outline is drawn. =item * C - the fill for the box. If this is supplied then the box will be -filled. See L<"Fill Parameters">. +filled. See L. =back -=item arc +=item arc() $img->arc(color=>$red, r=>20, x=>200, y=>100, d1=>10, d2=>20 ); @@ -316,12 +316,12 @@ C - ending angle of the arc, in degrees. Default: 361. =item * -C - the color of the filled arc. See L<"Color Parameters">. +C - the color of the filled arc. See L. Default: white. Overridden by C. =item * -C - the fill for the filled arc. See L<"Fill Parameters"> +C - the fill for the filled arc. See L =item * @@ -351,7 +351,7 @@ C - set to 0 to draw only an outline. $img->arc(x => 100, y => 150, r => 90, filled => 0, color => '#0f0', aa => 1, d1 => 90, d2 => 180); -=item circle +=item circle() $img->circle(color=>$green, r=>50, x=>200, y=>100, aa=>1, filled=>1); @@ -377,12 +377,12 @@ C - radius of the circle. Default: 1/3 of min(image height, image width). =item * -C - the color of the filled circle. See L<"Color Parameters">. +C - the color of the filled circle. See L. Default: white. Overridden by C. =item * -C - the fill for the filled circle. See L<"Fill Parameters"> +C - the fill for the filled circle. See L =item * @@ -427,12 +427,12 @@ to supplying the C parameter. =item * -C - the color of the filled polygon. See L<"Color Parameters">. +C - the color of the filled polygon. See L. Default: black. Overridden by C. =item * -C - the fill for the filled circle. See L<"Fill Parameters"> +C - the fill for the filled circle. See L =back @@ -464,19 +464,19 @@ C, C - the start point of the fill. =item * -C - the color of the filled area. See L<"Color Parameters">. +C - the color of the filled area. See L. Default: white. Overridden by C. =item * -C - the fill for the filled area. See L<"Fill Parameters"> +C - the fill for the filled area. See L =item * C - the border color of the region to be filled. If this parameter is supplied flood_fill() will stop when it finds this color. If this is not supplied then a normal fill is done. C can be -supplied as a L<"Color Parameter">. +supplied as a L. =back @@ -498,7 +498,7 @@ array references containing a set of pixels to be set. =item * -color - the color of the pixels drawn. See L<"Color Parameters">. +color - the color of the pixels drawn. See L. Default: white. =back @@ -543,7 +543,7 @@ Default: C<'8bit'>. =back -=item string +=item string() my $font = Imager::Font->new(file=>"foo.ttf"); $img->string(x => 50, y => 70, @@ -617,7 +617,7 @@ of C. C - for drivers that support it, treat the string as UTF-8 encoded. For versions of perl that support Unicode (5.6 and later), this will be enabled automatically if the C parameter is -already a UTF-8 string. See L for more +already a UTF-8 string. See L for more information. =item * @@ -634,7 +634,7 @@ C - alias for the C parameter. On error, string() returns false and you can use $img->errstr to get the reason for the error. -=item align_string +=item align_string() Draws text aligned around a point on the image. @@ -769,7 +769,7 @@ C<< $img->errstr >> to get the reason for the error. =item setscanline() Set all or part of a horizontal line of pixels to an image. This -method is most useful in conjunction with L. +method is most useful in conjunction with L. The parameters you can pass are: @@ -858,7 +858,7 @@ done with convert too: =item getscanline() Read all or part of a horizontal line of pixels from an image. This -method is most useful in conjunction with L. +method is most useful in conjunction with L. The parameters you can pass are: @@ -927,7 +927,7 @@ Or do it using packed data: } } -Some of the examples for L for more examples. +Some of the examples for L for more examples. =item getsamples() diff --git a/lib/Imager/Engines.pod b/lib/Imager/Engines.pod index 0f471359..71b1a4da 100644 --- a/lib/Imager/Engines.pod +++ b/lib/Imager/Engines.pod @@ -508,7 +508,7 @@ A spiral built on top of a color wheel. For details on expression parsing see L. For details on the virtual machine used to transform the images, see -L. +L. # generate a colorful spiral # requires that Parse::RecDescent be installed @@ -537,7 +537,7 @@ L. =over -=item matrix_transform +=item matrix_transform() Rather than having to write code in a little language, you can use a matrix to perform affine transformations, using the matrix_transform() diff --git a/lib/Imager/Files.pod b/lib/Imager/Files.pod index fa35a04a..dcb1be5e 100644 --- a/lib/Imager/Files.pod +++ b/lib/Imager/Files.pod @@ -68,8 +68,8 @@ code snippet is sufficient: print join " ", keys %Imager::formats; This will include some other information identifying libraries rather -than file formats. For new code you might find the L or -L methods useful. +than file formats. For new code you might find the L +or L methods useful. =over @@ -126,7 +126,7 @@ C method: Imager->write_multi({ file=> $filename, type=>$type }, @images) or die "Cannot write $filename: ", Imager->errstr; -=item read_types +=item read_types() This is a class method that returns a list of the image file types that Imager can read. @@ -140,7 +140,7 @@ It is possible for extra file read handlers to be loaded when attempting to read a file, which may modify the list of available read types. -=item write_types +=item write_types() This is a class method that returns a list of the image file types that Imager can write. @@ -307,7 +307,7 @@ C<\&Imager::def_guess_type>. =over -=item def_guess_type +=item def_guess_type() This is the default function Imager uses to derive a file type from a file name. This is a function, not a method. @@ -602,7 +602,7 @@ Any future IPTC data decoding is likely to go into tags. =back -=head2 GIF (Graphics Interchange Format) +=head2 GIF When writing one of more GIF images you can use the same L as you can when converting @@ -674,8 +674,9 @@ This value is not used when writing. ("Transparent Color Index") gif_trans_color - A reference to an Imager::Color object, which is the color to use for the palette entry used to represent transparency in -the palette. You need to set the C option (see L) for this value to be used. +the palette. You need to set the C option (see +L) for this value to be +used. =item * @@ -1351,7 +1352,7 @@ method: =over -=item register_reader +=item register_reader() Registers single or multiple image read functions. @@ -1441,7 +1442,7 @@ Example: }, ); -=item register_writer +=item register_writer() Registers single or multiple image write functions. @@ -1527,7 +1528,7 @@ to autoload it. =over -=item preload +=item preload() This preloads the file support modules included with or that have been included with Imager in the past. This is intended for use in forking diff --git a/lib/Imager/Filters.pod b/lib/Imager/Filters.pod index 9e79383f..55db398d 100644 --- a/lib/Imager/Filters.pod +++ b/lib/Imager/Filters.pod @@ -128,14 +128,18 @@ value it may be omitted when calling the filter function. Every one of these filters modifies the image in place. If none of the filters here do what you need, the -L or L function -may be useful. +L or L +function may be useful. + +=for stopwords +autolevels bumpmap bumpmap_complex conv gaussian hardinvert hardinvertall +radnoise turbnoise unsharpmask gradgen postlevels A reference of the filters follows: =over -=item C +=item autolevels scales the value of each channel so that the values in the image will cover the whole possible range for the channel. C and C @@ -150,7 +154,7 @@ the range respectively. $img->filter(type=>"autolevels", lsat=>0.2, usat=>0.2) or die $img->errstr; -=item C +=item bumpmap uses the channel C image C as a bump map on your image, with the light at (C, C), with a shadow length @@ -160,7 +164,7 @@ of C. lightx=>10, lighty=>10, st=>5) or die $img->errstr; -=item C +=item bumpmap_complex uses the channel C image C as a bump map on your image. If C<< Lz < 0 >> the three L parameters are considered to be the @@ -173,7 +177,7 @@ coefficient. C is the shininess of the surface. $img->filter(type=>"bumpmap_complex", bump=>$bumpmap_img) or die $img->errstr; -=item C +=item contrast scales each channel by C. Values of C < 1.0 will reduce the contrast. @@ -186,7 +190,7 @@ will reduce the contrast. $img->filter(type=>"contrast", intensity=>0.8) or die $img->errstr; -=item C +=item conv performs 2 1-dimensional convolutions on the image using the values from C. C should be have an odd length and the sum of the @@ -204,7 +208,7 @@ coefficients must be non-zero. $img->filter(type=>"conv", coef=>[ -0.5, 1, -0.5 ]) or die $img->errstr; -=item C +=item fountain renders a fountain fill, similar to the gradient tool in most paint software. The default fill is a linear fill from opaque black to @@ -406,7 +410,7 @@ Really. It even loads GIMP gradient files. =for stopwords Gaussian -=item C +=item gaussian performs a Gaussian blur of the image, using C as the standard deviation of the curve used to combine pixels, larger values give @@ -425,7 +429,7 @@ values around 5 provide a very strong blur. $img->filter(type=>"gaussian", stddev=>5) or die $img->errstr; -=item C +=item gradgen renders a gradient, with the given I at the corresponding points (x,y) in C and C. You can specify the way distance is @@ -437,7 +441,7 @@ for Euclidean squared, and 2 for Manhattan distance. yo=>[ 10, 50, 50 ], colors=>[ qw(red blue green) ]); -=item C +=item hardinvert XX inverts the image, black to white, white to black. All color channels @@ -446,7 +450,7 @@ are inverted, excluding the alpha channel if any. $img->filter(type=>"hardinvert") or die $img->errstr; -=item C +=item hardinvertall XX inverts the image, black to white, white to black. All channels are @@ -455,14 +459,14 @@ inverted, including the alpha channel if any. $img->filter(type=>"hardinvertall") or die $img->errstr; -=item C +=item mosaic produces averaged tiles of the given C. $img->filter(type=>"mosaic", size=>5) or die $img->errstr; -=item C +=item noise adds noise of the given C to the image. If C is zero, the noise is even to each channel, otherwise noise is added to @@ -478,7 +482,7 @@ each channel independently. =for stopwords Perlin -=item C +=item radnoise renders radiant Perlin turbulent noise. The center of the noise is at (C, C), C controls the angular scale of the noise , @@ -488,7 +492,7 @@ and C the radial scale, higher numbers give more detail. ascale=>1, rscale=>0.02) or die $img->errstr; -=item C +=item postlevels alters the image to have only C distinct level in each channel. @@ -496,7 +500,7 @@ channel. $img->filter(type=>"postlevels", levels=>10) or die $img->errstr; -=item C +=item turbnoise renders Perlin turbulent noise. (C, C) controls the origin of the noise, and C the scale of the noise, with lower numbers @@ -507,7 +511,7 @@ giving more detail. =for stopwords unsharp -=item C +=item unsharpmask performs an unsharp mask on the image. This increases the contrast of edges in the image. @@ -544,7 +548,7 @@ to I in the GIMP's unsharp mask filter. Default: 1.0. =back -=item C +=item watermark applies C as a watermark on the image with strength C, with an origin at (C, C) @@ -566,7 +570,7 @@ them into Imager's filter() method: =over -=item register_filter +=item register_filter() Registers a filter so it is visible via Imager's filter() method. @@ -615,7 +619,7 @@ See L for an example. =head2 Plug-ins The plug in interface is deprecated. Please use the Imager API, see -L and L for details +L and L for details It is possible to add filters to the module without recompiling Imager itself. This is done by using DSOs (Dynamic shared object) available @@ -647,7 +651,7 @@ Linux, Solaris, HPUX, OpenBSD, FreeBSD, TRU64/OSF1, AIX, Win32, OS X. =over -=item load_plugin +=item load_plugin() This is a function, not a method, exported by default. You should import this function explicitly for future compatibility if you need @@ -657,7 +661,7 @@ Accepts a single parameter, the name of a shared library file to load. Returns true on success. Check Imager->errstr on failure. -=item unload_plugin +=item unload_plugin() This is a function, not a method, which is exported by default. You should import this function explicitly for future compatibility if you diff --git a/lib/Imager/Font.pm b/lib/Imager/Font.pm index 9e60607c..a7e13bd2 100644 --- a/lib/Imager/Font.pm +++ b/lib/Imager/Font.pm @@ -544,9 +544,7 @@ the FreeType 2.x driver by setting C to C<'ft2'>: =back - - -=item bounding_box +=item bounding_box() Returns the bounding box for the specified string. Example: @@ -652,7 +650,7 @@ parameter. C - For drivers that support it, treat the string as UTF-8 encoded. For versions of perl that support Unicode (5.6 and later), this will be enabled automatically if the 'string' parameter is already a UTF-8 -string. See L for more information. Default: the C value +string. See L for more information. Default: the C value passed to Imager::Font->new(...) or 0. =item * @@ -671,7 +669,7 @@ and height of the text instead. =item string() The $img->string(...) method is now documented in -L +L =item align(string=>$text,size=>$size,x=>...,y=>...,valign => ...,halign=>...) @@ -779,7 +777,9 @@ C - set both horizontal and vertical resolution to this value. Returns a list containing the previous C, C values. -=item transform(matrix=>$matrix) +=item transform() + + $font->transform(matrix=>$matrix); Applies a transformation to the font, where matrix is an array ref of numbers representing a 2 x 3 matrix: @@ -826,7 +826,7 @@ at least one character. C - For drivers that support it, treat the string as UTF-8 encoded. For versions of perl that support Unicode (5.6 and later), this will be enabled automatically if the 'string' parameter is -already a UTF-8 string. See L for more information. Default: +already a UTF-8 string. See L for more information. Default: the C value passed to Imager::Font->new(...) or 0. =back @@ -859,7 +859,7 @@ included. =item draw This is used by Imager's string() method to implement drawing text. -See L. +See L. =back diff --git a/lib/Imager/Handy.pod b/lib/Imager/Handy.pod index d624a62e..93f47dd7 100644 --- a/lib/Imager/Handy.pod +++ b/lib/Imager/Handy.pod @@ -37,7 +37,7 @@ new() method. =item NCF() -Create a new L object, supplying any parameters +Create a new L object, supplying any parameters to the new() method. my $colorf = NCF(1.0, 0, 0); diff --git a/lib/Imager/ImageTypes.pod b/lib/Imager/ImageTypes.pod index fbc8c4c4..840a1bb3 100644 --- a/lib/Imager/ImageTypes.pod +++ b/lib/Imager/ImageTypes.pod @@ -137,7 +137,7 @@ that not all code follows this (recent) rule, but will over time. =over -=item new +=item new() $img = Imager->new(); $img->read(file=>"alligator.ppm") or die $img->errstr; @@ -318,7 +318,7 @@ value of C is undef. print "Image height: ", $img->getheight(), "\n"; -Same details apply as for L. +Same details apply as for L. =item getchannels() @@ -434,7 +434,7 @@ means only channels 0 and 2 are writable. $img->setmask(mask=>$mask); # restore previous mask C is used to set the channel mask of the image. See -L for details. +L for details. =back @@ -609,14 +609,14 @@ the palette, the image will be internally converted to a normal image. =over -=item to_paletted +=item to_paletted() You can create a new paletted image from an existing image using the to_paletted() method: $palimg = $img->to_paletted(\%opts) -where %opts contains the options specified under L. +where %opts contains the options specified under L. # convert to a paletted image using the web palette # use the closest color to each pixel @@ -645,7 +645,7 @@ RGB image with: No parameters. -=item masked +=item masked() Creates a masked image. A masked image lets you create an image proxy object that protects parts of the underlying target image. @@ -871,7 +871,7 @@ CIC<,>IC<,>IC<)>, eg color(255,0,0). =head2 Quantization options These options can be specified when calling -L, write_multi() for GIF files, when +L, write_multi() for GIF files, when writing a single image with the C option set to C, or for direct calls to i_writegif_gen() and i_writegif_callback(). diff --git a/lib/Imager/Transformations.pod b/lib/Imager/Transformations.pod index 39aea2a3..63250df2 100644 --- a/lib/Imager/Transformations.pod +++ b/lib/Imager/Transformations.pod @@ -80,14 +80,14 @@ A list of the transformations that do not alter the source image follows: =over -=item copy +=item copy() To create a copy of an image use the C method. This is useful if you want to keep an original after doing something that changes the image. $newimg = $orig->copy(); -=item scale +=item scale() XTo scale an image so proportions are maintained use the C<$img-Escale()> method. if you give either a C or @@ -525,7 +525,7 @@ A list of the transformations that alter the source image follows: =over -=item paste +=item paste() XTo copy an image to onto another image use the C method. @@ -720,7 +720,7 @@ interactive paint software. compose() returns true on success. On failure check $target->errstr for the reason for failure. -=item flip +=item flip() An inplace horizontal or vertical flip is possible by calling the C method. If the original is to be preserved it's possible to @@ -740,7 +740,7 @@ reason for failure. =over -=item convert +=item convert() You can use the convert method to transform the color space of an image using a matrix. For ease of use some presets are provided. @@ -872,7 +872,7 @@ alpha channel: [ 0, 0, 0, 0.5 ], ]); -=item combine +=item combine() X Combine channels from one or more input images into a new image. @@ -913,7 +913,7 @@ used from the extra images. =over -=item map +=item map() You can use the map method to map the values of each channel of an image independently using a list of look-up tables. It's important to diff --git a/t/x20spell.t b/t/x20spell.t index 11b0021a..00d9e4b6 100644 --- a/t/x20spell.t +++ b/t/x20spell.t @@ -38,7 +38,7 @@ bilevel const dpi eg -guassian +gaussian ie infix metadata diff --git a/t/x30podlinkcheck.t b/t/x30podlinkcheck.t new file mode 100644 index 00000000..24266050 --- /dev/null +++ b/t/x30podlinkcheck.t @@ -0,0 +1,134 @@ +#!perl -w +use strict; +use Test::More; +use Pod::Parser; +use File::Find; +use File::Spec::Functions qw(rel2abs abs2rel splitdir); + +# external stuff we refer to +my @known = + qw(perl Affix::Infix2Postfix Parse::RecDescent GD Image::Magick Graphics::Magick CGI Image::ExifTool XSLoader DynaLoader); + +my @pod; # files with pod + +my $base = rel2abs("blib/lib"); + +my @files; +find(sub { + -f && /\.(pod|pm)$/ + and push @files, $File::Find::name; + }, $base); + +my %targets = map { $_ => {} } @known; +my %item_in; + +for my $file (@files) { + my $parser = PodPreparse->new; + + my $link = abs2rel($file, $base); + $link =~ s/\.(pod|pm|pl|PL)$//; + $link = join("::", splitdir($link)); + + $parser->{'targets'} = \%targets; + $parser->{'link'} = $link; + $parser->{'file'} = $file; + $parser->{item_in} = \%item_in; + $parser->parse_from_file($file); + if ($targets{$link}) { + push @pod, $file; + } +} + +plan tests => scalar(@pod); + +for my $file (@pod) { + my $parser = PodLinkCheck->new; + $parser->{"targets"} = \%targets; + my $relfile = abs2rel($file, $base); + (my $link = $relfile) =~ s/\.(pod|pm|pl|PL)$//; + $link = join("::", splitdir($link)); + $parser->{"file"} = $relfile; + $parser->{"link"} = $link; + my @errors; + $parser->{"errors"} = \@errors; + $parser->{item_in} = \%item_in; + $parser->parse_from_file($file); + + unless (ok(!@errors, "check links in $relfile")) { + print "# $_\n" for @errors; + } +} + +package PodPreparse; +BEGIN { our @ISA = qw(Pod::Parser); } + +sub command { + my ($self, $cmd, $para) = @_; + + my $targets = $self->{"targets"}; + my $link = $self->{"link"}; + $targets->{$link} ||= {}; + + if ($cmd =~ /^(head[1-5]|item)/) { + $para =~ s/X<.*?>//g; + $para =~ s/\s+$//; + $targets->{$link}{$para} = 1; + push @{$self->{item_in}{$para}}, $link; + } +} + +sub verbatim {} + +sub textblock {} + +package PodLinkCheck; +BEGIN { our @ISA = qw(Pod::Parser); } + +sub command {} + +sub verbatim {} + +sub textblock { + my ($self, $para, $line_num) = @_; + + $self->parse_text + ( + { -expand_seq => "sequence" }, + $para, $line_num, + ); +} + +sub sequence { + my ($self, $seq) = @_; + + if ($seq->cmd_name eq "L") { + my $raw = $seq->raw_text; + my $base_link = $seq->parse_tree->raw_text; + $base_link =~ /^(https?|ftp|mailto):/ + and return ''; + (my $link = $base_link) =~ s/.*\|//; + my ($pod, $part) = split m(/), $link, 2; + $pod ||= $self->{link}; + if ($part) { + $part =~ s/^\"//; + $part =~ s/"$//; + } + my $targets = $self->{targets}; + my $errors = $self->{errors}; + (undef, my $line) = $seq->file_line; + + if (!$targets->{$pod}) { + push @$errors, "$line: No $pod found ($raw)"; + } + elsif ($part && !$targets{$pod}{$part}) { + push @$errors, "$line: No item/section '$part' found in $pod ($raw)"; + if ($self->{item_in}{$part}) { + push @$errors, " $part can be found in:"; + push @$errors, map " $_", @{$self->{item_in}{$part}}; + } + } + } + + return $seq->raw_text; +} + -- 2.39.5