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
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
=================================================================
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/\.[^.]*$//;
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
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>
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
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
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);