<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Raymond Law: Tag intridea</title>
    <link>http://blog.rayvinly.com/articles/tag/intridea</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Badger Rails Plugin</title>
      <description>&lt;p&gt;&lt;em&gt;(I also posted about this plugin in the &lt;a href="http://intridea.com/2008/6/16/announcing-the-badger-rails-plugin"&gt;Intridea blog&lt;/a&gt; )&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://github.com/rayvinly/badger/tree/master"&gt;Badger&lt;/a&gt; (hosted at &lt;a href="http://github.com/"&gt;GitHub&lt;/a&gt;) is a simple Rails plugin that creates badges.  A site often allows its users to upload a profile image.  A profile image is just that, an image resized to fit in a predefined space to show up in the user&amp;#8217;s profile.&lt;/p&gt;


	&lt;p&gt;With Badger, you can have something prettier &amp;#8211; a badge that shows the user-uploaded image on top of another image that identifies the user as a part of the community.  We have company badges, security badges, so why not web badges to have your users show off his/her affection for your site?&lt;/p&gt;


	&lt;p&gt;Badger works by accepting cropping parameters of the overlay image in a hash (x1, y1, width, height), which is used to crop the overlay image.  It then resizes the cropped image to the size specified by composite_width and composite_height in badger.yml.  Finally, it places the resized image on top of the background image at location specified by composite_x and composite_y in badger.yml.  The resulting image is saved back to either the filesystem or Amazon S3, using attachment_fu.&lt;/p&gt;


	&lt;p&gt;Badger requires the attachment_fu plugin, ImageMagick, and MiniMagick.  Also, the JavaScript Image Cropper UI can be used to obtain the cropping parameters from the users.&lt;/p&gt;


	&lt;p&gt;For example:&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://img.skitch.com/20080415-s2twpkugcjfmpp27fqs42upi7.png" alt="" /&gt;
+
&lt;img src="http://img.skitch.com/20080415-xukti26i4q12bhr8tdxegadsbx.png" alt="" /&gt;
=
&lt;img src="http://img.skitch.com/20080415-g1k6y99fk5fnn4qti76xcyutp8.png" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Here I overlay &lt;span class="caps"&gt;RUBY&lt;/span&gt; on top of &lt;span class="caps"&gt;JAVA&lt;/span&gt; to produce &lt;span class="caps"&gt;I LOVE RUBY&lt;/span&gt;.&lt;/p&gt;</description>
      <pubDate>Mon, 23 Jun 2008 10:00:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:b89d8dd8-08ec-4f8a-8f86-684c535d8736</guid>
      <author>Raymond Law</author>
      <link>http://blog.rayvinly.com/articles/2008/06/23/badger-rails-plugin</link>
      <category>Ruby on Rails</category>
      <category>Web 2.0</category>
      <category>badger</category>
      <category>ruby</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>plugin</category>
      <category>github</category>
      <category>intridea</category>
      <trackback:ping>http://blog.rayvinly.com/articles/trackback/58</trackback:ping>
    </item>
  </channel>
</rss>
