场景复现
经常有小伙伴在使用PbootCms的过程中遇到上传的图片被压缩了,变得模糊。
出现这个情况基本上可以断定上传的原图一定尺寸过大了。
PbootCms模板默认上传图片限制宽度1920像素
缩略图的限制大小是1000*1000像素
解决方案
打开文件:config/config.php,大约在42行。如下
// 上传配置'upload' => array('format' => 'jpg,jpeg,png,gif,xls,xlsx,doc,docx,ppt,pptx,rar,zip,pdf,txt,mp4,avi,flv,rmvb,mp3,otf,ttf','max_width' => '1920','max_height' => ''),// 缩略图配置'ico' => array('max_width' => '1000','max_height' => '1000'),// 上传配置 'upload' => array( 'format' => 'jpg,jpeg,png,gif,xls,xlsx,doc,docx,ppt,pptx,rar,zip,pdf,txt,mp4,avi,flv,rmvb,mp3,otf,ttf', 'max_width' => '1920', 'max_height' => '' ), // 缩略图配置 'ico' => array( 'max_width' => '1000', 'max_height' => '1000' ),// 上传配置 'upload' => array( 'format' => 'jpg,jpeg,png,gif,xls,xlsx,doc,docx,ppt,pptx,rar,zip,pdf,txt,mp4,avi,flv,rmvb,mp3,otf,ttf', 'max_width' => '1920', 'max_height' => '' ), // 缩略图配置 'ico' => array( 'max_width' => '1000', 'max_height' => '1000' ),
我们只需要调整下 max_widht 、 max_height 的数值即可。例如想用缩略图做banner的朋友,就可以将 ico 的 max_width 调整为 1920 :
到此,问题解决。
© 版权声明
本站所有资源(模板、图片)搜集整理于互联网或者网友提供,仅供学习与交流使用,如果不小心侵犯到你的权益,请及时联系我们删除该资源。
THE END
暂无评论内容