游客
游客
阅读:11332 回复:1

水印图片添加不上的bug

楼主#
更多 发布于:2016-12-06 17:33


1.3.2 单商户版源码(2016-11-01)

UeditorController.class.php 文件中imageUp 方法
        if(!isset($info['upfile'])){
            $info['upfile'] = $info['Filedata'];
        }else{
            //编辑器插入图片水印处理
            if($this->savePath=='Goods/'){
                $image = new ThinkImage();
                $water = tpCache('water');
                $imgresource = ".".$info['upfile']['urlpath'];
                $image->open($imgresource);
                if($water['is_mark']==1 && $image->width()>$water['mark_width'] && $image->height()>$water['mark_height']){
                    if($water['mark_type'] == 'text'){
                        $image->text($water['mark_txt'],'./hgzb.ttf',20,'#000000',9)->save($imgresource);
                    }else{
                        $image->water(".".$water['mark_img'],9,$water['mark_degree'])->save($imgresource);
                    }
                }
            }
        }

(1)将此处代码中的"}else{"去掉,将内部代码块拿出来。

(2)hgzb.ttf 字体源码中不存在,可网上下载相应字体,放到程序合适的位置,改好路径。


(3)'Goods/' 改为'goods/'

RoBin
贫民
贫民
  • UID9027
  • 粉丝0
  • 关注0
  • 发帖数1
沙发#
发布于:2018-02-28 16:51
改了不行啊
游客

返回顶部