Instamatic
Instamatic is a gem that lets you run a generator to create an image placement service in minutes.
Once your project is set up, just drop images (PNG files with transparency) into the images/
folder and launch like any Sinatra app.
Add a config.ru file, and you're ready to push to heroku.
Requests to the root of your site land on an instruction page with a detailed explanation of how the URL scheme of the service works.
Other URLs are parsed by the route matcher against the following two schemes. Note: all params but the first are optional in reverse order from the end.
TL;DR:
/some_image_name/width/height/hex_color_w_no_leading_hash/scale/
e.g. http://www.rappersonthe.rocks/l_l_cool_j/800/600/ffc0cb/
or
/width/height/hex_color_w_no_leading_hash/scale/
e.g. http://www.rappersonthe.rocks/640/480/000000/200/
A working example of the homepage and service is available at http://www.rappersonthe.rocks
Installation
Add this line to your application's Gemfile:
gem 'instamatic'
And then execute:
$ bundle
Or install it yourself as:
$ gem install instamatic
Usage
Getting started is easy!
- After installing the gem, run
setup_instamatic
to get a prompt to generate theimages/
folder and atemplates/
folder with erb templates for the homepage to copy-edit. - Drop your images into
images/
and run the server withrackup
,shotgun
, orruby
. - That's it!
Contributing
Bug reports and pull requests are welcome on GitHub at https://bitbucket.org/aneely/instamatic.
License
The gem is available as open source under the terms of the MIT License.