From b4e3e1d76f400cf11de00e517fae89179d6d852f Mon Sep 17 00:00:00 2001 From: Nova Kwok Date: Fri, 25 Mar 2022 10:51:49 +0800 Subject: [PATCH] Update README (#113) --- README.md | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 226f09e9..95d58c37 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,33 @@ It will convert `jpg,jpeg,png` files by default, this can be customized by editi > We've now support Safari/Chrome/Firefox on iOS 14/iPadOS 14 -## Simple Usage Steps +## Simple Usage Steps(with Binary) -### 1. Download or build the 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 +cp /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](https://docs.webp.sh/usage/docker/) + + + +### 2. Download the binary Download the `webp-server` from [release](https://github.com/webp-sh/webp_server_go/releases) page. -### 2. Dump config file +### 3. Dump config file ``` ./webp-server -dump-config > config.json @@ -43,6 +64,7 @@ The default `config.json` may look like this. "ENABLE_AVIF": false } ``` +> AVIF support is disabled by default as converting images to AVIF is CPU consuming. #### Config Example @@ -52,7 +74,7 @@ In the following example, the image path and website URL. | ------------------------------------- | ------------------------------------ | | `/var/www/img.webp.sh/path/tsuki.jpg` | `https://img.webp.sh/path/tsuki.jpg` | -The `config.json` should be like: +The `IMG_PATH` inside `config.json` should be like: | IMG_PATH | | ---------------------- |