pressly/imgry

Name: imgry

Owner: Pressly Inc.

Description: On-demand image sizing+delivery for responsive applications

Created: 2015-04-22 14:15:14.0

Updated: 2018-05-21 20:00:11.0

Pushed: 2018-05-08 15:22:45.0

Homepage:

Size: 27927

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Imgry

Imgry is an on-demand image delivery web service for responsive applications.

Usage

First install Go 1.7+ and copy the etc/imgry.conf.sample (the default is fine), then..

mgry/
 tools
 deps
 build
n/imgry-server -config=etc/imgry.conf

Open browser to:

http://localhost:4446/mybucket?url=http://i.imgur.com/vEZy2Oh.jpg

this will download the image from the source, cache it, persist it, and return the sized image (in this case, with zero sizing) to the client.

Now, some other variations:

Scale to 300x

http://localhost:4446/mybucket?url=http://i.imgur.com/vEZy2Oh.jpg&size=300x

Resize to exactly 300x300

http://localhost:4446/mybucket?url=http://i.imgur.com/vEZy2Oh.jpg&size=300x300

Resize to 300x300 and maintain aspect ratio

http://localhost:4446/mybucket?url=http://i.imgur.com/vEZy2Oh.jpg&size=300x300&op=cover

Same as above with a cropbox at points (x1:10%,y1:10%) to (x2:90%,y2:90%)

http://localhost:4446/mybucket?url=http://i.imgur.com/vEZy2Oh.jpg&size=300x300&op=cover&cb=0.1,0.1,0.9,0.9

Webapp usage
 src="http://localhost:4446/mybucket?url=http%3A%2F%2Fi.imgur.com%2FvEZy2Oh.jpg&size=300x300&op=cover" />
Caching and persistence

Imgry is built with some clever caching such as:

Deployment

A Dockerfile is packaged with the project that includes a custom build of ImageMagick 6.9 with the latest libjpeg-turbo and libpng.

We use github.com/siddontang/ledisdb in production instead of redisdb. It's an Redis-API compatible engine that is designed for long-term persistence of the data set.. pretty much Redis on LevelDB.

Other
License

MIT License (See LICENSE file)


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.