function SetPreviewImageDimensions($img, &$newImgWidth, &$newImgHeight)
{
$equal2Width = 60;
$arrayImg = getimagesize($img);
$ImgWidth = $arrayImg[0];
$ImgHeight = $arrayImg[1];
if ($ImgWidth > $equal2Width) {
$newImgWidth = $equal2Width;
$newImgHeight = ($ImgHeight/$ImgWidth) * $newImgWidth;
}
else {
$newImgWidth = $ImgWidth;
$newImgHeight = $ImgHeight;
}
}
Variables $newImgWidth and $newImgHeight are passed by refference, so the returned values of width and height will be passed in these variables for your later use.
No comments:
Post a Comment