<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

Dedecms 生成漂亮整齐的缩略图

时间:2020-12-15

修改文件: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) 

更改为 
 
代码如下:

($ni,$im,0,0,$src_X,$src_Y,$ftoW,$ftoH,$srcW,$srcH) 

其实就一小小改动,就是在原图中截取最大面积的符合自定义缩略图长宽比列的一部分生成缩略图。 
0
首页
案例
关于
联系