Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    GD::Image::Orientation 0.05

    Download button

    No screenshots available
    Downloads: 381  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Daniel Muey | More programs
    Perl Artistic License / FREE
    April 24th, 2007, 11:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    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 object
    If 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 square

    horizontal()

    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 object

    If 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

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    manage GD::Image | horizontal orientation | Perl module | GD::Image::Orientati | manage | GD::Image

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM