A simple helper wrapper to generate progressive web thumbnails using imagemagick within go.
Usage:
err, imagemagick := imwrapper.New()
if err != nil {
t.Fatalf("could not instantiate imagemagick: %v", err)
}
quality := 95
maxDimension := 2048
autoRotate := true
imagemagick.Convert("input.jpg", "output.jpg", quality, maxDimension, autoRotate)
You need to have imagemagick
installed.
The tests are dockerized, to ensure they run with imagemagick convert
and identify
available.
docker run --rm -it $(docker build -q .)
coverage: 85.4% of statements
These tests make sure the commands to imagemagick convert
and identify
are working.
v0
for now as I'll probably only be using it.
Distributed under the MIT License. See LICENSE
for more information.
- Robert van Alphen - robertalpha
- Thanks to the creators of the excellent open source project
imagemagick