Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/whosonfirst/java-dropwizard-squeegee

squeegee is a simple Dropwizard-based HTTP pony to convert SVG documents in to PNG files using the Batik SVG transcoder.
https://github.com/whosonfirst/java-dropwizard-squeegee

batik dropwizard java svg

Last synced: about 2 months ago
JSON representation

squeegee is a simple Dropwizard-based HTTP pony to convert SVG documents in to PNG files using the Batik SVG transcoder.

Awesome Lists containing this project

README

        

# java-dropwizard-squeegee

`squeegee` is a simple [Dropwizard-based](http://www.dropwizard.io/) HTTP pony to convert SVG documents in to PNG files using the [Batik](https://xmlgraphics.apache.org/batik) SVG transcoder.

## How to start the squeegee application

1. Run `mvn clean install` to build your application
1. Start application with `java -jar target/squeegee-0.1.jar server config.yml`
1. To check that your application is running enter url `http://localhost:8080`

## Usage

Given a file like [this](examples/circles.svg):

```



```

You would invoke `squeegee` like this:

```
curl -s -v -X POST -F [email protected] http://localhost:8080
```

Which would produce [this](examples/circles.png):

![circles](examples/circles.png)

## Docker

[Yes](Dockerfile). For example:

```
docker build -t squeegee .
docker run -it -p 6161:8080 squeegee
curl -s -v -X POST -F [email protected] http://localhost:6161 > circles.png
```

## Caveats

* This does not have a (Dropwizard) health check yet. [It should](https://github.com/whosonfirst/java-dropwizard-squeegee/issues/1).

## Things that `squeegee` can't do yet

* User-defined image dimensions - or more specifically, it doesn't resize images particularly well yet; you can pass a `height` and `width` parameter with your request and see for yourself but you should be aware _this functionality might still be removed_
* User-defined (CSS) stylesheets
* That other thing you're wondering about that I haven't thought of yet

## See also

* https://xmlgraphics.apache.org/batik/using/transcoder.html
* http://www.dropwizard.io/1.0.0/docs/index.html