Public | Automated Build

Last pushed: 6 months ago
Short Description
Service that provides REST interface to imagemagick
Full Description

TransformImgs


Image transformations service.

The first iteration goal:

  • Provide API to predefined operations implemented using imagemagick CLI.

Table of Contents

Install

Using docker:

$ docker pull dpokidov/transformimgs

Usage

$ docker run -p 8080:8080 dpokidov/transformimgs

To test that application started successfully:

$ curl http://localhost:8080/health

You should get 'OK' string in the response.

At the moment application provides 4 operations that accessible through HTTP endpoints:

  • /img - optimises image
  • /img/resize - resizes image
  • /img/fit - resize image to the exact size by resizing and cropping it
  • /img/asis - returns original image

Detailed API docs are here - http://docs.pixboost.com/api/index.html

Running the application locally from sources

$ docker-compose up

Building and Running from sources

Dependencies:

$ go get github.com/tools/godep
$ go get github.com/dooman87/transformimgs
$ cd $GOPATH/src/github.com/dooman87/transformimgs
$ godep restore
$ go run cmd/main.go -imConvert=/usr/bin/convert

Perfomance tests

There is a JMeter performance test that you can run against a service. To make it run

  • Run performance test environment:
    $ docker-compose -f docker-compose-perf-test.yml up
    
  • Run JMeter test:
    $ jmeter -n -t perf-test.jmx -l ./results.jmx -e -o ./results
    

API

You can go through API docs and try it out there as well. Use
API key MTg4MjMxMzM3MA__ to transform any images from pixabay.com.

Go-swagger is used to generate swagger.json file from sources. To generate:

$ go get -u github.com/go-swagger/go-swagger/cmd/swagger
$ cd cmd/
$ swagger generate spec -o ../swagger.json

Contribute

Shout out with any ideas. PRs are more than welcome.

License

MIT

Todo

  • Consider using Zopfli for PNGs
Docker Pull Command
Owner
dpokidov
Source Repository