场景复现
经常有小伙伴在使用PbootCms的过程中遇到上传的图片被压缩了,变得模糊。
出现这个情况基本上可以断定上传的原图一定尺寸过大了。
PbootCms模板默认上传图片限制宽度1920像素
缩略图的限制大小是1000*1000像素
 
解决方案
打开文件:config/config.php,大约在42行。如下

01 // 上传配置
02     'upload' => array(
03         'format' => 'jpg,jpeg,png,gif,xls,xlsx,doc,docx,ppt,pptx,rar,zip,pdf,txt,mp4,avi,flv,rmvb,mp3,otf,ttf',
04         'max_width' => '1920',
05         'max_height' => ''
06     ),
07      
08     // 缩略图配置
09     'ico' => array(
10         'max_width' => '1000',
11         'max_height' => '1000'
12     ),
我们只需要调整下 max_widht 、 max_height 的数值即可。例如想用缩略图做banner的朋友,就可以将 ico 的 max_width 调整为 1920 :
到此,问题解决。