in reply to HTML image resizing with Image::Info based on max height/width
#!/usr/bin/perl use warnings; use strict; my $height = "1000"; my $width = "1234"; my $maxh = "600"; my $maxw = "800"; if ($height > $maxh || $width > $maxw) { my $hratio = $height / $maxh; my $wratio = $width / $maxw; my $newh = $height / $hratio; my $neww = $width / $hratio; print "Height is now $newh, Width is now $neww"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: HTML image resizing with Image::Info based on max height/width
by almut (Canon) on Jun 12, 2007 at 02:43 UTC |