ImageScaler
DISCLAIMER: This is my first project in Go and is under construction.
Please do not use it in a production environment (at least yet
😄)
There are a lot of TODOs to be done.
Contributions and comments are more than welcome.
Image scaler is tiny service that aims to serve "Image processing as a
service".
Currently it only supports image resizing.
Usage
After you build the application you can just run the executable.
By default the HTTP server runs on port 3000.
There is no sane way to configure this right now, except changing the
code and recompiling the whole app.
You can try it with an HTTP get request on /resize
route.
At the moment, it supports 3 url params
- url [required] The url containing the image we want to resize
- width [default 1280] The desired width of the new image
- height [default 0] The desired height of the new image (pass 0 to
maintain the aspect ratio)
You can try it with a request like
http://127.0.0.1:3000/resize?url=http://upload.wikimedia.org/wikipedia/commons/4/45/GuitareClassique5.png&width=200&height=0
It returns a JSON like
{
URL: "http://127.0.0.1:3000/static/resized_cf2a7e4bc924dbde5530459152c33117.png"
}