Show
Ignore:
Timestamp:
07/10/08 17:16:23 (17 months ago)
Author:
bchoate
Message:

Updated POD.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-41/lib/MT/Image.pm

    r2649 r2747  
    466466=head1 USAGE 
    467467 
    468 =head2 MT::Image->new(%arg) 
     468=head2 MT::Image->new( %arg ) 
    469469 
    470470Constructs a new I<MT::Image> object. Returns the new object on success; on 
     
    491491=back 
    492492 
    493 =head2 $img->scale(%arg) 
     493=head2 $img->scale( %arg ) 
    494494 
    495495Creates a thumbnail from the image represented by I<$img>; on success, returns 
     
    519519 
    520520=back 
     521 
     522=head2 MT::Image->inscribe_square( %arg ) 
     523 
     524Calculates a square of dimensions that are capable of holding an image 
     525of the height and width indicated. This method receives I<%arg>, which 
     526may contain: 
     527 
     528=over 4 
     529 
     530=item * Height 
     531 
     532=item * Width 
     533 
     534=back 
     535 
     536The square will be the smaller value of the Height and Width parameter. 
     537 
     538The method returns a hash containing the following information: 
     539 
     540=over 4 
     541 
     542=item * Size 
     543 
     544The size of the calculated square, in pixels. 
     545 
     546=item * X 
     547 
     548The horizontal space to crop from the image, in pixels. 
     549 
     550=item * Y 
     551 
     552The vertical space to crop from the image, in pixels. 
     553 
     554=back 
     555 
     556This information is suited for the L<crop> method. 
     557 
     558=head2 $img->make_square() 
     559 
     560Takes an image which may or may not be a square in dimension and forces 
     561it into a square shape (trimming the longer side, as necesary). 
    521562 
    522563=head2 $img->get_dimensions(%arg) 
     
    529570between 1 to 100). 
    530571 
     572=head2 MT::Image->check_upload( %arg ) 
     573 
     574Utility method used to handle image upload and storage, along with some 
     575constraining factors. The I<%arg> hash may contain the following elements: 
     576 
     577=over 4 
     578 
     579=item * Fh 
     580 
     581A filehandle for the uploaded file. 
     582 
     583=item * Fmgr 
     584 
     585A handle to a L<MT::FileMgr> object that will be used for writing the 
     586file into place. 
     587 
     588=item * Local 
     589 
     590A path and filename for the location to write the uploaded file. 
     591 
     592=item * Max (optional) 
     593 
     594A number that specifies the maximum physical file size for the uploaded 
     595image (specified in bytes). 
     596 
     597=item * MaxDim (optional) 
     598 
     599A number that specifies the maximum dimension allowed for the uploaded 
     600image (specified in pixels). 
     601 
     602=back 
     603 
     604If the uploaded image is valid and passes the file size and image 
     605dimension requirements (assuming those parameters are given), 
     606the return value is a list consisting of the following elements: 
     607 
     608=over 4 
     609 
     610=item * $width 
     611 
     612The width of the uploaded image, in pixels. 
     613 
     614=item * $height 
     615 
     616The height of the uploaded image, in pixels. 
     617 
     618=item * $id 
     619 
     620A string identifying the type of image file (returned by L<Image::Size>, 
     621so typically "GIF", "JPG", "PNG"). 
     622 
     623=item * $write_coderef 
     624 
     625A Perl coderef that, when invoked writes the image to the specified 
     626location. 
     627 
     628=back 
     629 
     630If any error occurs from this routine, it will return 'undef', and 
     631assign the error message, accessible using the L<errstr> class method. 
     632 
    531633=head1 AUTHOR & COPYRIGHT 
    532634