last-supper

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2017 License: MIT Imports: 11 Imported by: 0

README

last-supper

A dummy image service written in Go.

This is basically a rewrite of imgsrc with the only difference that it is written in Go and therefore doesn't require the JVM.

Note that last-supper isn't a drop-in replacement for imgsrc because it isn't fully API compatible.

Install

Download the pre-built binary for your platform from the releases tab. If you want you can put it somewhere in your PATH.

Building from source

If you have Go installed on your machine you can also just run

go get github.com/Fahrradflucht/last-supper

Assuming you GOPATH is in your PATH you should now be able to just execute last-supper.

Usage

$ last-supper --help
Usage of last-supper:
  -port int
    	Port on which to run the server. (default 8080)
  -font string
    	Path to a ttf file to be used as image font

Without any addtional configuration last-supper will listen on port 8080 for requests with the following schema: http://localhost:8080/{width}x{height}/{bg-color}/{text-color}/{text}.{format}

Where:

  • width is an integer between 0 and 5000
  • height is an integer between 0 and 5000
  • bg-color is a hex color code (3 or 6 digits)
  • fg-color is a hex color code (3 or 6 digits)
  • text is a string to be rendered to the image
  • format is a one of:
    • .png to get a PNG
    • .bmp to get a BMP
    • .jpg or .jpeg to get a JPEG
    • .gif to get a GIF (Note: Gif generation is very slow for large images)

So this request for example:

http://localhost:8080/1024x300/040/bada55/last-supper.jpeg

Would return this image: last-supper

License

MIT © Mathis Wiehl

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL