<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Leon Dewey</title>
 <link href="http://leondewey.com/atom.xml" rel="self"/>
 <link href="http://leondewey.com/"/>
 <updated>2010-10-22T23:30:05+11:00</updated>
 <id>http://leondewey.com/</id>
 <author>
   <name>Leon Dewey</name>
   <email>leon@leondewey.com</email>
 </author>

 
 <entry>
   <title>Image Hammer - fun with Sinatra and Mini magic</title>
   <link href="http://leondewey.com/2010/10/19/image-hammer.html"/>
   <updated>2010-10-19T00:00:00+11:00</updated>
   <id>http://leondewey.com/2010/10/19/image-hammer</id>
   <content type="html">&lt;h1&gt;Image Hammer &amp;#8211; fun with Sinatra and Mini magic&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;19 Oct 2010 &amp;#8211; Sydney&lt;/p&gt;
&lt;p&gt;Image hammer is basically a image manipulation service. It has two modes one is based on a profile you create via a rest api and the another revolves around a &lt;span class=&quot;caps&quot;&gt;GET&lt;/span&gt;.&lt;/p&gt;
&lt;h4&gt;The &lt;span class=&quot;caps&quot;&gt;GET&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;The get is the the most basic of the two approaches. You pass a image and some manipulation instructions along with a hash and get back the result.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://image-hammer.heroku.com/anything.jpg?resize=100x100&amp;amp;url=http://leondewey.com/images/bike.jpg&amp;amp;hash=f48c45837044a00f622e66064cd631d5&quot;&gt;http://image-hammer.heroku.com/anything.jpg?resize=100&amp;#215;100&amp;amp;url=http://leondewey.com/images/bike.jpg&amp;amp;hash=f48c45837044a00f622e66064cd631d5&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;The rest api&lt;/h4&gt;
&lt;p&gt;With this approach you create a profile (Via a http &lt;span class=&quot;caps&quot;&gt;POST&lt;/span&gt;) then you get a clean url to hit&lt;/p&gt;
&lt;script src=&quot;http://gist.github.com/636373.js&quot;&gt; &lt;/script&gt;&lt;p&gt;Then you can hit the following urls:&lt;br /&gt;
- &lt;a href=&quot;http://image-hammer.heroku.com/leondewey-small/bike.jpg&quot;&gt;http://image-hammer.heroku.com/leondewey-small/bike.jpg&lt;/a&gt;&lt;br /&gt;
- &lt;a href=&quot;http://image-hammer.heroku.com/leondewey-medium/bike.jpg&quot;&gt;http://image-hammer.heroku.com/leondewey-medium/bike.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Orignal&lt;br /&gt;
- &lt;a href=&quot;http://leondewey.com/images/bike.jpg&quot;&gt;http://leondewey.com/images/bike.jpg&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Installation&lt;/h4&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ git clone git://github.com/leondewey/image-hammer.git
$ cd image-hammer
$ ruby app.rb&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note you will need the following gems:&lt;br /&gt;
- sinatra&lt;br /&gt;
- sinatra/authorization&lt;br /&gt;
- sinatra/sequel&lt;br /&gt;
- mini_magick&lt;/p&gt;</content>
 </entry>
 
 
</feed>
