$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;
}
?
详细解决方案
php 按最大尺度 等比例缩放图片
热度:141 发布时间:2012-12-25 16:18:28.0
相关解决方案