discuz手机版图片缩略图大小设置/修改清晰度

discuz手机版 图片缩略图大小设置/修改清晰度
\template\default\mobile\forum\discuzcode.htm和

\template\default\touch\forum\discuzcode.htm

\source\class\class_image.php

forum_image.php 负责生成缓存缩略图共手机客户端显示
discuzcode.htm 负责传递参数给forum_image.php  ,并显示缩略图
class_image.php 含有生成缩略图的类

找到discuzcode.htm文件,搜索“200”会有两处代码如下
 
function imagelist($attach) { global $_G;
$attach['refcheck'] = (!$attach['remote'] && $_G['setting']['attachrefcheck']) || ($attach['remote'] && ($_G['setting']['ftp']['hideurl'] || ($attach['isimage'] &&$_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp')));
$mobilethumburl = $attach['attachimg'] && $_G['setting']['showimages'] && (!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] ||$_G['uid'] == $attach['uid']) ? getforumimg($attach['aid'], 0, 200, 200, 'fixnone') : '' ;
$aidencode = packaids($attach); $is_archive = $_G['forum_thread']['is_archived'] ?"&fid=".$_G['fid']."&archiveid=".$_G[forum_thread][archiveid] : ''; }
size参数改大了之后你再在手机上看效果,缩略图是不是变大了?
看看,是不是我的网站缩略图还是原来那么大(200PX),但是清晰度怎么异常高呢?还有个小窍门,暂且让我保留一会儿,呵呵~
 
找到 static/image/mobile/style.css
修改这段样式中的红色字体

.plc .pi .message img,.plc .pi .img_one img { margin:0px 4px 0px 0; max-width:300px; max-height:300px; }

别急,你发现没有,虽然缩略图尺寸变大了,但是图像质量仍然很差?窍门在这里,请继续往下看:
查找class_image.php代码

if($thumbwidth < 100 && $thumbheight < 100) {
                        $this->param['thumbquality'] = 100;
                }

复制代码

替换成以下代码

  //if($thumbwidth < 100 && $thumbheight < 100) {
                        $this->param['thumbquality'] = 100;
                //}

复制代码
至此,手机版缩略图已经完美解决了

huan

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: