Giter VIP home page Giter VIP logo

Comments (5)

xujinzheng avatar xujinzheng commented on July 17, 2024

extend is for compatibility for new versions or not commonly used args.

from go-wkhtmltox.

xujinzheng avatar xujinzheng commented on July 17, 2024

the new version committed, please try.

quality is int type

"quality": 94

from go-wkhtmltox.

NITEMAN avatar NITEMAN commented on July 17, 2024

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.

xujinzheng avatar xujinzheng commented on July 17, 2024

can you try https://github.com/idocking/go-wkhtmltox ?

from go-wkhtmltox.

NITEMAN avatar NITEMAN commented on July 17, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.