- call read() instead of open() in the example code in Imager.pm,
authorTony Cook <tony@develop=help.com>
Thu, 10 Feb 2005 13:12:56 +0000 (13:12 +0000)
committerTony Cook <tony@develop=help.com>
Thu, 10 Feb 2005 13:12:56 +0000 (13:12 +0000)
  and mention that open() is an alias for read().
  http://rt.cpan.org/NoAuth/Bug.html?id=11431
- added reference list of crop() parameters.
  http://rt.cpan.org/NoAuth/Bug.html?id=11430

Changes
Imager.pm
lib/Imager/Files.pod
lib/Imager/Transformations.pod

diff --git a/Changes b/Changes
index b7f4375b3f80feccf7ce2d69eb24363c5e3cd425..69746007f14536fd3f607918ab6b62cccdc0e013 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1014,6 +1014,12 @@ Revision history for Perl extension Imager.
   freetype 2.x to return a larger than expected text width.
   http://rt.cpan.org/NoAuth/Bug.html?id=11291
 - add scaleX/scaleY to the method index and gives them some examples
+  http://rt.cpan.org/NoAuth/Bug.html?id=11328
+- call read() instead of open() in the example code in Imager.pm,
+  and mention that open() is an alias for read().
+  http://rt.cpan.org/NoAuth/Bug.html?id=11431
+- added reference list of crop() parameters.
+  http://rt.cpan.org/NoAuth/Bug.html?id=11430
 
 =================================================================
 
index d1c5ea087cdb256ed89045a876aaee47537758c5..5c70b49aa4dbee7692ad82cd6d08910f4c62ac41 100644 (file)
--- a/Imager.pm
+++ b/Imager.pm
@@ -2702,8 +2702,8 @@ Imager - Perl extension for Generating 24 bit Images
   my $format;
 
   my $img = Imager->new();
-  # see Imager::Files for information on the open() method
-  $img->open(file=>$file) or die $img->errstr();
+  # see Imager::Files for information on the read() method
+  $img->read(file=>$file) or die $img->errstr();
 
   $file =~ s/\.[^.]*$//;
 
@@ -2815,7 +2815,7 @@ An Image object is created with C<$img = Imager-E<gt>new()>.
 Examples:
 
   $img=Imager->new();                         # create empty image
-  $img->open(file=>'lena.png',type=>'png') or # read image from file
+  $img->read(file=>'lena.png',type=>'png') or # read image from file
      die $img->errstr();                      # give an explanation
                                               # if something failed
 
@@ -2903,15 +2903,18 @@ matrix_transform() - L<Imager::Engines/"Matrix Transformations">
 
 new() - L<Imager::ImageTypes>
 
+open() - L<Imager::Files> - an alias for read()
+
 paste() - L<Imager::Transformations/paste> - draw an image onto an image
 
 polygon() - L<Imager::Draw/polygon>
 
 polyline() - L<Imager::Draw/polyline>
 
-read() - L<Imager::Files>
+read() - L<Imager::Files> - read a single image from an image file
 
-read_multi() - L<Imager::Files>
+read_multi() - L<Imager::Files> - read multiple images from an image
+file
 
 rotate() - L<Imager::Transformations/rotate>
 
@@ -2945,9 +2948,10 @@ type() -  L<Imager::ImageTypes> - type of image (direct vs paletted)
 virtual() - L<Imager::ImageTypes> - whether the image has it's own
 data
 
-write() - L<Imager::Files>
+write() - L<Imager::Files> - write an image to a file
 
-write_multi() - L<Imager::Files>
+write_multi() - L<Imager::Files> - write multiple image to an image
+file.
 
 =head1 CONCEPT INDEX
 
index 0b611ef0d667d31c3894eb1639d17be8463f32b4..32e99fd7494c1ec3ebab8ab2020e15ee3b8c2023 100644 (file)
@@ -79,6 +79,8 @@ When you read an image, Imager may set some tags, possibly including
 information about the spatial resolution, textual information, and
 animation information.  See L<Imager::ImageTypes/Tags> for specifics.
 
+The open() method is a historical alias for the read() method.
+
 =head2 Input and output
 
 When reading or writing you can specify one of a variety of sources or
index 582fe0cec8abcdd996068d3d98ce3044fe3616d3..f1cf883bd6bbc048a4934031277e82ffc2dfc5bd 100644 (file)
@@ -131,6 +131,44 @@ crop are the edges of the area that you want in the returned image,
 where the right and bottom edges are non-inclusive.  If a parameter is
 omitted a default is used instead.
 
+The possible parameters are:
+
+=over
+
+=item *
+
+C<left> - the left edge of the area to be cropped.  Default: 0
+
+=item *
+
+C<top> - the top edge of the area to be cropped.  Default: 0
+
+=item *
+
+C<right> - the right edge of the area to be cropped.  Default: right
+edge of image.
+
+=item *
+
+C<bottom> - the bottom edge of the area to be cropped.  Default:
+bottom edge of image.
+
+=item *
+
+C<width> - width of the crop area.  Ignored if both C<left> and C<right> are
+supplied.  Centered on the image if neither C<left> nor C<right> are
+supplied.
+
+=item *
+
+C<height> - height of the crop area.  Ignored if both C<top> and
+C<bottom> are supplied.  Centered on the image if neither C<top> nor
+C<bottom> are supplied.
+
+=back
+
+For example:
+
   # these produce the same image
   $newimg = $img->crop(left=>50, right=>100, top=>10, bottom=>100); 
   $newimg = $img->crop(left=>50, top=>10, width=>50, height=>90);