dependabot[bot] 9efead2479
Bump github.com/stretchr/testify from 1.7.5 to 1.8.0 (#128)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.5 to 1.8.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.5...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-30 17:18:27 +08:00
2022-06-30 17:14:07 +08:00
2021-12-04 17:25:26 +08:00
2021-02-01 17:00:37 +08:00
2021-12-05 19:21:29 +08:00
2022-03-24 21:25:44 +08:00
2022-06-19 15:49:49 +08:00
2021-12-12 20:47:23 +08:00
2021-12-05 19:21:29 +08:00
2020-02-29 18:38:56 +08:00
2021-12-05 19:21:29 +08:00
2022-03-26 20:04:29 +08:00
2022-03-24 21:25:44 +08:00
2021-12-05 19:21:29 +08:00
2021-12-05 19:21:29 +08:00
2021-12-04 17:25:26 +08:00

CI build docker image Release WebP Server Go Binaries codecov

Documentation | Website

This is a Server based on Golang, which allows you to serve WebP images on the fly. It will convert jpg,jpeg,png files by default, this can be customized by editing the config.json..

  • currently supported image format: JPEG, PNG, BMP, GIF(static image for now)

e.g When you visit https://your.website/pics/tsuki.jpgit will serve as image/webp format without changing the URL.

For Safari and Opera users, the original image will be used. We've now support Safari/Chrome/Firefox on iOS 14/iPadOS 14

Simple Usage Steps(with Binary)

1. Prepare the environment

If you'd like to run binary directly on your machine, you need to install some dependencies(as AVIF encoder needs it):

Ubuntu

apt install libaom-dev -y
ln -s /usr/lib/x86_64-linux-gnu/libaom.so /usr/lib/x86_64-linux-gnu/libaom.so.3

CentOS7

yum install libaom-devel -y

If you don't like to hassle around with your system, so do us, why not have a try using Docker? >> Docker | WebP Server Documentation

2. Download the binary

Download the webp-server from release page.

3. Dump config file

./webp-server -dump-config > config.json

The default config.json may look like this.

{
  "HOST": "127.0.0.1",
  "PORT": "3333",
  "QUALITY": "80",
  "IMG_PATH": "/path/to/pics",
  "EXHAUST_PATH": "/path/to/exhaust",
  "ALLOWED_TYPES": ["jpg","png","jpeg","bmp"],
  "ENABLE_AVIF": false
}

AVIF support is disabled by default as converting images to AVIF is CPU consuming.

Config Example

In the following example, the image path and website URL.

Image Path Website Path
/var/www/img.webp.sh/path/tsuki.jpg https://img.webp.sh/path/tsuki.jpg

The IMG_PATH inside config.json should be like:

IMG_PATH
/var/www/img.webp.sh

EXHAUST_PATH is cache folder for output webp images, with EXHAUST_PATH set to /var/cache/webp in the example above, your webp image will be saved at /var/cache/webp/pics/tsuki.jpg.1582558990.webp.

3. Run

./webp-server --config=/path/to/config.json

4. Nginx proxy_pass

Let Nginx to proxy_pass http://localhost:3333/;, and your webp-server is on-the-fly.

Advanced Usage

For supervisor, Docker sections, please read our documentation at https://docs.webp.sh/

License

WebP Server is under the GPLv3. See the LICENSE file for details.

Description
重构二开版Go version of WebP Server. A tool that will serve your JPG/PNG/BMP/SVGs as WebP/AVIF format with compression, on-the-fly.
Readme GPL-3.0 32 MiB
Languages
Go 95.8%
Dockerfile 2.1%
Makefile 1.5%
Shell 0.6%