织梦模板自动生成的缩略图片其实是根据自定义的最大长宽,原比例的缩小原图片,不利于图片索引页排版,不得已CSS里采用了自动判断调整高宽---但比较耗资源。所以还是决定改改缩图函数----再次感谢DEDE的开源!!
打开image.func.php或inc_photograph.php
if($toWH<=$srcWH){
$ftoW=$toW;
$ftoH=$ftoW*($srcH/$srcW);
}
else{
$ftoH=$toH;
$ftoW=$ftoH*($srcW/$srcH);
}
改为
$ftoH=$toH;
$ftoW=$toW;
if ($toWH<=$srcWH) {
$src_Y = 0;
$src_X = ($srcW-$srcH*$toWH)/2;
$srcW = $srcH*$toWH;
} else {
$src_X = 0;
$src_Y = ($srcH-$srcW/$toWH)/2;
$srcH = $srcW/$toWH;
}
($ni,$im,0,0,0,0,$ftoW,$ftoH,$srcW,$srcH)