| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The Image2webp project is an application written with golang that supports real-time transcoding of multiple image formats into webp images.
Currently support JPG, JPEG, PNG, BMP, GIF these formats into Webp format.
'Webp' format can significantly reduce the size of the picture without affecting the picture quality, so as to improve the speed of network transmission, save bandwidth traffic resources.
This project also supports webp format thumbnail function, is also real-time transcoding, can be configured to the existing server without invasion, only need to do some forwarding in nginx, do not change any other logic.
The best realization of this project is to start this service in the picture server and configure forwarding in nginx or other web servers, Just match the url format ^(.+)_webp(_(\d+)_(\d+)(.*))? to forward to the image2webp program and output the webp image.
If it is the front end to access the picture, when the request volume is large, this real-time transcoding method will cause CPU performance, so for the large request volume, please see, before you must use the CDN file.
Set the CDN image cache expiration date a little longer, the service is only used back to the source, that is perfect.
Compilation is very simple, make sure your go version is 1.16 and above, and turn on support for mod.
Execute the make command and it will compile automatically. Of course, you can also manually execute the full path compiler command.
$ go build -v -o image2webpAfter compiling successfully, you can execute
$ ./image2webp start --config=./config.jsonTo start it.
config.json Is in json format.
image2webp deployment is also very convenient, just need to put the compiled binaries directly on the server to run, Then configure the front - end proxy, you can refer to nginx.conf.
| Back | FazBrowse Home | New Git URL |