Comments (5)
extend
is for compatibility for new versions or not commonly used args.
from go-wkhtmltox.
the new version committed, please try.
quality is int type
"quality": 94
from go-wkhtmltox.
Maybe because we're wrapping it in docker (https://github.com/sbitio/docker-wkhtmltox), but still doesn't work (image sizes are are plain explicative if you try my example)
from go-wkhtmltox.
can you try https://github.com/idocking/go-wkhtmltox
?
from go-wkhtmltox.
It doesn't work either using that container (and container is somehow broken):
niteman@teg:~/tmp$ ls -lah
total 8,0K
drwxr-xr-x 2 niteman niteman 4,0K mar 13 15:07 .
drwxr-xr-x 49 niteman niteman 4,0K mar 13 14:46 ..
niteman@teg:~/tmp$ # container doesn't work as expected
niteman@teg:~/tmp$ docker run --rm -it -d -p 9080:8080 idocking/go-wkhtmltox:latest
fbce9ef927dd7dc4867a190700c4eeac42d93b8dfe253b4eeaf472f8411d7362
niteman@teg:~/tmp$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b387fe76ebc2 traefik "/traefik --api --do…" 7 months ago Up 3 weeks 0.0.0.0:80->80/tcp, 0.0.0.0:8080->8080/tcp traefik_proxy
niteman@teg:~/tmp$ # make container work
niteman@teg:~/tmp$ docker run --rm -it -d -p 9080:8080 --entrypoint=/app/go-wkhtmltox idocking/go-wkhtmltox:latest run
200b7d50728292f1c3707b95f76b4adad4e20e6cbef8fa962eec32a52689e92c
niteman@teg:~/tmp$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
200b7d507282 idocking/go-wkhtmltox:latest "/app/go-wkhtmltox r…" 4 seconds ago Up 3 seconds 0.0.0.0:9080->8080/tcp ecstatic_grothendieck
b387fe76ebc2 traefik "/traefik --api --do…" 7 months ago Up 3 weeks 0.0.0.0:80->80/tcp, 0.0.0.0:8080->8080/tcp traefik_proxy
niteman@teg:~/tmp$ curl -s -X POST \
> "http://127.0.0.1:9080/v1/convert" \
> -H 'accept-encoding: gzip' \
> -H 'cache-control: no-cache' \
> -H 'content-type: application/json' \
> -d '{
> "to" : "image",
> "converter":{
> "format" : "png",
> "quality": 0,
> "uri": "https://sbit.io"
>
> },
> "template": "binary"
> }' --compressed -o sbit_using_quality.png
niteman@teg:~/tmp$ file sbit_using_quality.png
sbit_using_quality.png: PNG image data, 1024 x 1061, 8-bit/color RGBA, non-interlaced
niteman@teg:~/tmp$ curl -s -X POST \
> "http://127.0.0.1:9080/v1/convert" \
> -H 'accept-encoding: gzip' \
> -H 'cache-control: no-cache' \
> -H 'content-type: application/json' \
> -d '{
> "to" : "image",
> "converter":{
> "format" : "png",
> "extend": {"quality": "0" },
> "uri": "https://sbit.io"
>
> },
> "template": "binary"
> }' --compressed -o sbit_using_extend.png
niteman@teg:~/tmp$ file sbit_using_extend.png
sbit_using_extend.png: PNG image data, 1024 x 1061, 8-bit/color RGBA, non-interlaced
niteman@teg:~/tmp$ ls -lah *
-rw-r--r-- 1 niteman niteman 243K mar 13 15:09 sbit_using_extend.png
-rw-r--r-- 1 niteman niteman 4,2M mar 13 15:08 sbit_using_quality.png
This should be fairly plain to reproduce anywhere
from go-wkhtmltox.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-wkhtmltox.