时间:2021-07-01 10:21:17 帮助过:3人阅读
$maxWidth = 180;//最大宽度
$maxHeight = 125; //最大高度
$iSuofang = $arrPicwh['w']/$arrPicwh['h'];//原图的比例
$iSuo = $arrPicwh['h']/$arrPicwh['w'];
if ($arrPicwh['w'] > $arrPicwh['h'])//判断原图的宽高那个大
{
$dstW = $maxWidth;
$dstH = $maxWidth * $iSuo;
}else
{
$dstH = $maxHeight;
$dstW = $maxHeight * $iSuofang;
}
?