webp-sh / webp_server_go

Go version of WebP Server. A tool that will serve your JPG/PNG/BMP/SVGs as WebP/AVIF format with compression, on-the-fly.
https://docs.webp.sh
GNU General Public License v3.0
1.79k stars 173 forks source link

Image conversion to webp failed #352

Closed junyangfan closed 4 weeks ago

junyangfan commented 1 month ago

I'm very sorry, I encountered a problem during use. Many pictures were not converted successfully, and only a few pictures were successfully converted to webp format.

What is the reason? The log and configuration are as shown below, thank you very much.

Using the latest version of the webp-server-go image.

My site: https://blog.fjy.zone

n0vad3v commented 1 month ago

Thanks for your feedback!

Please pay attention to X-Compression-Rate header, in your screenshot it's 1, means two things:

  1. The image request is successfully processed by WebP Server Go
  2. The converted webp images size might be bigger than your original image, so in this case original image is returned. (You can check this by visiting remote-raw and exhaust directory to and pay attention to files with same filename)

You can try lowering the QUALITY parameter in your config, in that way the converted images should be smaller than original image, and the converted webp images shall be returned.

junyangfan commented 1 month ago

Thanks for your feedback!感谢您的反馈!

Please pay attention to X-Compression-Rate header, in your screenshot it's 1, means two things:请注意X-Compression-Rate标头,在您的屏幕截图中它是 1,意味着两件事:

  1. The image request is successfully processed by WebP Server GoWebP Server Go 成功处理图片请求
  2. The converted webp images size might be bigger than your original image, so in this case original image is returned. (You can check this by visiting remote-raw and exhaust directory to and pay attention to files with same filename)转换后的 webp 图像大小可能比原始图像大,因此在这种情况下将返回原始图像。 (您可以通过访问remote-rawexhaust目录来检查这一点,并注意具有相同文件名的文件)

You can try lowering the QUALITY parameter in your config, in that way the converted images should be smaller than original image, and the converted webp images shall be returned.您可以尝试降低配置中的QUALITY参数,这样转换后的图像应小于原始图像,并且将返回转换后的 webp 图像。

Thank you very much, I understand now.