仅供参考,请根据自己的需要修改。
打开 source/class/class_image.php 文件,
查找:- $this->param['watermarkfile'][$type] = './static/image/common/'.($this->param['watermarktype'][$type] == 'png' ? 'watermark.png' : 'watermark.gif');
复制代码
替换为:- if($this->imginfo['width']) $wmsize = $this->imginfo['width'] <= 1024 ? '' : ($this->imginfo['width'] <= 1536 ? '_200' : ($this->imginfo['width'] <= 2160 ? '_300' : ($this->imginfo['width'] <= 2880 ? '_400' : ($this->imginfo['width'] <= 3600 ? '_500' : '_500'))));
- $this->param['watermarkfile'][$type] = './static/image/common/watermark'.$wmsize.($this->param['watermarktype'][$type] == 'png' ? '.png' : '.gif');
复制代码 修改后,除上传 watermark.png 外,还要上传逐渐放大尺寸的 watermark_200.png, watermark_300.png, watermark_400.png, watermark_500.png 到 static/image/common/ 目录。 |