opencart 中的 png 压缩不起作用
我一直在搜索并试图找出为什么我无法让 png 图像压缩适用于我正在开发的 opencart 1.5 网站。
在 library/image.php 的第 46 行,我修改了 imagepng 函数以使用压缩 9 而不是默认的 0,并且它对我的图像没有影响。我从文件服务器中删除了图像,它们只是以完全相同的文件大小/质量重新填充。
有人知道如何减小图像的文件大小吗? 1000x750px 的图像超过 2M,它会缩短我的加载时间。
感谢!
I've been searching and trying to figure out why I can't get png image compression to work for an opencart 1.5 site I'm working on.
On line 46 of library/image.php I modified the imagepng function to use compression 9 instead of the default 0 and it had no affect on my images. I deleted the images from the fileserver and they just repopulate with the exact same file size/quality.
Anyone know how I can get the file sizes of my images down? A 1000x750px image is over 2M and it's killing my load times.
Thank!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这实际上对我有用。我将其从“0”更改为“9”,并清除了缓存图像,文件大小大约减少了 65%。
This actually worked for me. I changed it from "0" to "9" and cleared the cache images and the files sizes were about 65% less.
您可以只下载图像压缩扩展而不是编辑源代码,因为升级时您的更改将会丢失。
You can just download an image compression extension instead of editing source code because when you upgrade your changes will be lost.