织梦cms如何添加其他格式的图片呢?

这里以webp为类来实现一下如何让织梦支持webp

 

1、修改系统设置让织梦(dede)支持该图片格式,比如:webp(新图片格式)

系统->系统基本参数->附件设置->图片浏览器文件类型->

jpg|gif|png

改成

jpg|gif|png|webp

一般格式的图片在这里设置之后都会得到解决!

如果编辑的时候还是不能上传你所想要的拓片格式,请继续完成2、3步骤

 

2、让缩略图上传支持你所指定的图片格式

include\dialog\select_images_post.php

44行

$sparr = Array("image/pjpeg", "image/jpeg", "image/gif", "image/png", "image/xpng", "image/wbmp");

改成

$sparr = Array("image/pjpeg", "image/jpeg", "image/gif", "image/png", "image/xpng", "image/wbmp", "image/webp");

 

3、上传缩略图之后,在已传列表中显示缩略图(不然你即使上传了,也在列表里看不到图片哦!)

include\dialog\select_images.php

193行

else if(preg_match("#\.(gif|png)#i", $file))

改成

else if(preg_match("#\.(gif|png|webp)#i", $file))

 

第1、2、3步骤完成后你就可以愉快的上传你想要的图片格式了!

相关文章:

  • 2021-11-30
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-08-01
  • 2021-12-17
  • 2021-11-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-23
  • 2022-01-21
  • 2022-12-23
  • 2021-08-24
  • 2022-01-24
  • 2022-12-23
相关资源
相似解决方案