/**
Change the size of the picture proportionally (not generate thumbnails)
@param string $img picture path
@param int $max _w Maximum zoom relaxation
@param int $max _h Max zoom height
*/
function Chimagesize ($img, $max _w, $max _h)
{
$size = @getimagesize ($img);
$w = $size [0];
$h = $size [1];
Calculating the zoom ratio
@ $w _ratio = $max _w/$w;
@ $h _ratio = $max _h/$h;
Determine the image width and height after processing
if (($w <= $max _w) && ($h <= $max _h))
{
$tn [' w '] = $w;
$tn [' h '] = $h;
}
else if (($w _ratio * $h) < $max _h)
{
$tn [' h '] = ceil ($w _ratio * $h);
$tn [' w '] = $max _w;
}
Else
{
$tn [' w '] = ceil ($h _ratio * $w);
$tn [' h '] = $max _h;
}
$tn [' rc_w '] = $w;
$tn [' rc_h '] = $h;
return $tn;
}
?>
function description and examples
Change the size of the picture proportionally (not generate thumbnails)
http://www.bkjia.com/PHPjc/735073.html www.bkjia.com true http://www.bkjia.com/PHPjc/735073.html techarticle ?/** changes the picture size (not generated thumbnail) @param string $img picture path @param int $max _w maximum zoom @param int $max _h Max scale High */function Chimagesi Ze ...