$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; }
?
