update README.md (#237)

* update README.md

* #234
This commit is contained in:
Benny 2023-06-28 08:56:33 +02:00 committed by GitHub
parent 23bbed8ce6
commit 451f9a4145
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 8 deletions

View File

@ -10,27 +10,38 @@
[Documentation](https://docs.webp.sh/) | [Website](https://webp.sh/) [Documentation](https://docs.webp.sh/) | [Website](https://webp.sh/)
This is a Server based on Golang, which allows you to serve WebP images on the fly. 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`.. 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 * currently supported image format: JPEG, PNG, BMP, GIF
> e.g When you visit `https://your.website/pics/tsuki.jpg`it will serve as `image/webp` format without changing the URL. > e.g When you visit `https://your.website/pics/tsuki.jpg`it will serve as `image/webp` format without changing the
> URL.
> >
> ~~For Safari and Opera users, the original image will be used.~~ > ~~For Safari and Opera users, the original image will be used.~~
> We've now supported Safari/Chrome/Firefox on iOS 14/iPadOS 14 > We've now supported Safari/Chrome/Firefox on iOS 14/iPadOS 14
## Docker Usage steps
Please refer to [Docker | WebP Server Documentation](https://docs.webp.sh/usage/docker/) for more info.
## Simple Usage Steps(with Binary) ## Simple Usage Steps(with Binary)
> Note: There is a potential memory leak problem with this server and remains unsolved, we recommend using Docker to mitigate this problem. > Note: There is a potential memory leak problem with this server and remains unsolved, we recommend using Docker to
> mitigate this problem.
> Related discussion: https://github.com/webp-sh/webp_server_go/issues/75 > Related discussion: https://github.com/webp-sh/webp_server_go/issues/75
### 1. Prepare the environment ### 1. Prepare the environment
#### If you are using version after 0.6.0 #### If you are using version after 0.6.0
> Install `libvips` on your machine, more info [here](https://github.com/davidbyttow/govips) > Install `libvips` on your machine, minimum version 8.10.
> If your distro doesn't have a recent enough version, you can install it from source.
> We have an example for [CentOS 7](https://github.com/webp-sh/libvips/blob/master/build-full.sh)
> >
> * Ubuntu `apt install libvips-dev` > More info about [libvips](https://github.com/davidbyttow/govips)
>
> * Ubuntu `apt install --no-install-recommends libvips-dev`
> * macOS `brew install vips pkg-config` > * macOS `brew install vips pkg-config`
#### If you are using version before 0.6.0 #### If you are using version before 0.6.0

View File

@ -235,14 +235,14 @@ func webpEncoder(p1, p2 string, extraParams config.ExtraParams) error {
buf, _, err = img.ExportWebp(&vips.WebpExportParams{ buf, _, err = img.ExportWebp(&vips.WebpExportParams{
Lossless: true, Lossless: true,
StripMetadata: true, StripMetadata: true,
ReductionEffort: 2, ReductionEffort: 4,
}) })
} else { } else {
buf, _, err = img.ExportWebp(&vips.WebpExportParams{ buf, _, err = img.ExportWebp(&vips.WebpExportParams{
Quality: quality, Quality: quality,
Lossless: false, Lossless: false,
StripMetadata: true, StripMetadata: true,
ReductionEffort: 2, ReductionEffort: 4,
}) })
} }