GD::Image::Orientation

GD::Image::Orientation is a Perl extension for managing a GD::Image's vertical or horizontal orientation (shapewise).
Download

GD::Image::Orientation Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Daniel Muey
  • Publisher web site:
  • http://search.cpan.org/~dmuey/

GD::Image::Orientation Tags


GD::Image::Orientation Description

GD::Image::Orientation is a Perl extension for managing a GD::Image's vertical or horizontal orientation (shapewise). GD::Image::Orientation is a Perl extension for managing a GD::Image's vertical or horizontal orientation (shapewise).SYNOPSIS use GD::Image::Orientation; for(@images) { my $img = GD::Image->new($_) or die $!; $dbh->do("INSERT INTO photogallery.metainfo (Id,Orientation,File) VALUES (NULL,$img->isvertical,$dbh->quote($_))") or die $dbh->errstr; }Adds functionality to GD by adding class methods to determine orientation in boolean terms or in a string. Also included methods to set an image's orientation;isvertical() $img->isvertical()Returns true if an image's height is greater than it's width. Call it with a true argument: $img->isvertical(1)and it returns true if an image's height is greater than it's width or it is square.ishorizontal() $img->ishorizontal()Returns true if an image's width is greater than it's height. Call it with a true argument: $img->ishorizontal(1)and it returns true if an image's width is greater than it's height or it is square.issquare()Returns true if an image's width and height are the same.orientation()Returns a string describing its orientation in English. It returns 'horizontal', 'vertical', or 'square' print 'The image you uploaded is ' . $img->orientation . "n";vertical()If the image is horizontal it is rotated 90 degrees clockwise to become vertical. Call it with a true argument and it's rotated 90 degrees counter clockwise to become vertical.It returns a new GD::Image object if modified or the original object if its already vertical or square. my $vert_img = $img->vertical; # rotate $img clockwise 90 degrees if its horizontal my $vert_img = $img->vertical(1); # rotate $img counter clockwise 90 degrees if its horizontal $img = $img->vertical; # rotate $img clockwise 90 degrees if its horizontal, modifying the original objectIf the second argument is true it will rotate it even if its sqare: my $vert_img = $img->vertical(0,1); # rotate $img clockwise if its horizontal or square my $vert_img = $img->vertical(1,1); # rotate $img counter clockwise if its horizontal or squarehorizontal()If the image is vertical it is rotated 90 degrees clockwise to become horizontal. Call it with a true argument and it's rotated 90 degrees counter clockwise to become horizontal.It returns a new GD::Image object if modified or the original object if its already horizontal or square. my $hori_img = $img->horizontal; # rotate $img clockwise 90 degrees if its vertical my $hori_img = $img->horizontal(1); # rotate $img counter clockwise 90 degrees if its vertical $img = $img->horizontal; # rotate $img clockwise 90 degrees if its vertical, modifying the original objectIf the second argument is true it will rotate it even if its square: my $vert_img = $img->horizontal(0,1); # rotate $img clockwise if its vertical or square my $vert_img = $img->horizontal(1,1); # rotate $img counter clockwise if its vertical or square Requirements: · Perl


GD::Image::Orientation Related Software