百度的编辑器ueditor在不对图片进行缩放情况下,如何设置上传图片显示的最大宽度
2017-04-28 | 1188次 | 管理员 | 本站
在ueditor.all.js的24532有下面添加
loader.setAttribute(width, (json.width>800?800:json.width)||"");
其中的800就是你设置的上传图片时图片最大显示宽度
然后在uploader.class.php中第11行的后面添加
private $width;//图片宽度
private $height;//图片高度
在第127行的后面添加
$source_info = getimagesize($this->filePath);//图片信息
$this->width = $source_info[0];//图片宽度
$this->height = $source_info[1];//图片高度
在385行 public function getFileInfo()
{
return array(
"state" => $this->stateInfo,
"url" => $this->fullName,
"title" => $this->fileName,
"original" => $this->oriName,
"type" => $this->fileType,
"size" => $this->fileSize,
"width"=> $this->width,
"height" => $this->height
);
}
方法内的数组中间添加
"width"=> $this->width,
"height" => $this->height
即可实现 |