Math::RatioResize - Work out new dimensions for an image (or just a rectangle) when restricted in one dimension.
Version 0.03
Given a box dimensions (width and height), and a max width or height, return back the resized dimensions whilst maintaining the aspect-ratio.
use Math::RatioResize; my ( $w, $h ) = Math::RatioResize->resize( w => 360, h => 240, max_w => 100 ); $w == 100 $h == 66.66 # 240 * ( 100 / 360 )
As above.
Rob Brown, <rob at intelcompute.com>
<rob at intelcompute.com>
Please report any bugs or feature requests to bug-image-empty at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Math-RatioResize. I will be notified, and then you will automatically be notified of progress on your bug as I make changes.
bug-image-empty at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Math::RatioResize
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Math-RatioResize
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Math-RatioResize
CPAN Ratings
http://cpanratings.perl.org/d/Math-RatioResize
Search CPAN
http://search.cpan.org/dist/Math-RatioResize/
Copyright 2013 Rob Brown.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Math::RatioResize, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::RatioResize
CPAN shell
perl -MCPAN -e shell install Math::RatioResize
For more information on module installation, please visit the detailed CPAN module installation guide.