buaazp / zimg

A lightweight and high performance image storage and processing system.
http://zimg.buaa.us
BSD 3-Clause "New" or "Revised" License
2.69k stars 402 forks source link

无法将图片转为webp格式 #195

Closed stringpeng closed 7 years ago

stringpeng commented 7 years ago

我使用的是master分支的版本,运行后上传图片到服务器后通过f=webp参数查看页面会显示404,其他格式都正常。在log中会出现一条error记录 2017/07/20 04:06:11:098783 [ERROR] 172.17.0.1 fail pic:1ef1ccd79940ae496a5444183b50be2a w:0 h:0 p:1 g:0 x:-1 y:-1 r:0 q:75 f:webp 但是我在官方demo中发现webp是可以正常访问的 http://demo.buaa.us/5f189d8ec57f5a5a0d3dcba47fa797e2?w=300&h=300&f=webp 请问我是哪里配置错误了吗,想要使用webp有什么需要注意的地方吗?

lkh12400 commented 7 years ago

default 貌似是要在某个地方配置吧

buaazp commented 7 years ago

默认配置里应该就有webp,我估计是libwebp没编译好,导致无法转码成webp图片

stringpeng commented 7 years ago

libwebp不是通过apt-get安装的吗?是需要单独做编译安装?

wget http://downloads.webmproject.org/releases/webp/libwebp-0.4.1.tar.gz tar zxvf libwebp-0.4.1.tar.gz cd libwebp-0.4.1 ./configure make sudo make install

我通过上面的命令编译安装了libwebp,并重启了zimg。但是发现使用f=webp还是会显示404

stringpeng commented 7 years ago

我发现在centos系统下通过文档部署可直接成功并且webp格式也可以正常使用。但是之前我在ubuntu14.04版本下尝试多次都无法正常,也不知道是哪里做错了。推荐大家还是用centos系统搭建吧。