Crates.io | lcs-png-diff-server |
lib.rs | lcs-png-diff-server |
version | 0.1.6 |
source | src |
created_at | 2022-05-15 04:36:56.982703 |
updated_at | 2022-08-15 18:38:22.71923 |
description | PNG diff server with LCS algorithm |
homepage | https://github.com/jianliao/lcs-png-diff-server-rs |
repository | https://github.com/jianliao/lcs-png-diff-server-rs |
max_upload_size | |
id | 586910 |
size | 66,024 |
Pass in before and after bitmap URL, and then the server will generate LCS diff png and return the diff result URL in response.
$ cargo install lcs-png-diff-server
$ lcs-png-diff-server
curl \
-d '{
"before_png": "https://jianliao.github.io/lcs-test-pngs/before.png",
"after_png": "https://jianliao.github.io/lcs-test-pngs/after.png"
}' \
-H 'Content-Type: application/json' \
-X POST http://localhost:8080/api/diff
{
"result_url": "http://localhost:8080/assets/b02d9094-bc6c-4c40-923e-50c66bcf1951.png"
}
$ lcs-png-diff-server --help
lcs-png-diff-server
A server for generating diff bitmaps from png files
USAGE:
lcs-png-diff-server [OPTIONS]
OPTIONS:
-a, --addr <ADDR> set the listen addr [default: 0.0.0.0]
-h, --help Print help information
-l, --log <LOG_LEVEL> set the log level [default: info]
-p, --port <PORT> set the listen port [default: 8080]
--static-dir <STATIC_DIR> set the directory where static files are to be found [default:
./assets]
You can customize the hostname of the diff result URL by setting the HOST_INFO
environment variable.
HOST_INFO=https://localhost:443/ lcs-png-diff-server
jianliao/lcs-png-diff-server is a demo-only docker image. CORS had enabled for GET and POST.
$ docker run --rm -it -p 8080:8080 jianliao/lcs-png-diff-server:0.1.4
$ docker run --rm -it jianliao/lcs-png-diff-server:0.1.4 --help
$ docker run --rm -it -p 3000:3000 jianliao/lcs-png-diff-server:0.1.4 -p 3000
$ docker run --rm -it -p 8080:8080 jianliao/lcs-png-diff-server:0.1.4 -l debug
$ docker run --rm -it -e HOST_INFO=https://domainname/ -p 8080:8080 jianliao/lcs-png-diff-server:0.1.4
Apache License Version 2.0