Home >Backend Development >PHP Tutorial >PHP image proportional scaling to generate thumbnail function sharing_PHP tutorial
$resizerreagH =true; The smallest aspect ratio between the thumbnail width and height and the original image is the smallest one if($resizereagW && $resizerreagH){
$radio = $dsimgWratio;
else
$radio = $ $radio = $dsimgWratio;
resizerreagH){
$imgnewH = $pic_H * $radio;
if(function_exists("imgcopyresampled" )){
//Create the target resource canvas
$dst = imagecreatetruecolor ($imgnewW, $imgnewH);
imagecopyresampled ($dst,$im, 0,0,0,0,$imgnewW,$ imgnewH, $pic_W, $pic_H); imgnewW,$imgnewH,$imgnewH,$pic_W,$pic_H);
}
$arr[$filetype]($dst,$thumbname.".$filetype");
The width and height of the original image
//Then the width and height of the thumbnail are the width and height of the original image
filetype");
imagedestroy();
}
}
?>