Browse files

add some documentation

  • Loading branch information...
1 parent 52c6e8d commit e9e6639e8e762174258816b307b15fd6a74cbaae Jeff Sutherland committed Nov 25, 2009
Showing with 60 additions and 7 deletions.
  1. +1 −0 README
  2. +56 −0 README.rdoc
  3. +3 −7 attachment_on_the_fly.gemspec
@@ -0,0 +1 @@
+See README.rdoc for more information.
56 README.rdoc
@@ -1,8 +1,64 @@
=Attachment on the Fly
+Attachment on the Fly is a module that extends Paperclip by allowing dynamic
+image resizing without going through ActiveRecord first. This gem can only
+resize images. If you try to resize a PDF or other attachment, nothing will
+* thoughtbot-paperclip gem
+* ImageMagick
==Quick Start
+Attachment on the Fly is hosted on Gemcutter, so it is recommended that you
+install the Gemcutter gem before installing Attachment on the Fly.
+See for installation instructions. Then:
+sudo gem install attachment_on_the_fly
+Setup your models the same way you normally do with Paperclip. See
+ for detailed instructions.
+Once your attachments are working with Paperclip, add this line to the top of
+your models:
+require "attachment_on_the_fly"
+To use, reference the instance of your attachment like this:
+<%= my_image_model.attachment.s_640_480 %>
+This will output an image path based on your url interpolation and a resized
+image named S_640_480_your_image_name.jpg (or gif or png).
+Attachment on the Fly can accept three types of inputs: width by height, height
+proportional, and width proportional.
+my_image_model.attachment.s_640_480 will generate a 640x480 pixel image.
+my_image_model.attachment.s_640_width will generate an image that is 640 pixels
+wide and proportionally high based on the original image dimensions.
+my_image_model.attachment.s_480_height will generate an image that is 480 pixels
+high and proportionally wide based on the original image dimensions.
+When an image's instance is first accessed through the s_ method, a new image
+will be generated according to the image's path interpolation. Then, every time
+the image is accessed with the same dimensions, the previously generated image
+will be used. This allows the flexibility to resize images at will but still be
+able to cache previously generated images.
+Currently, convert's sharpen is set to 1. If you need to change the sharpness
+or any other of convert's command line options, you will need to do so in the
+final lines of lib/attachment_on_the_fly.rb. We are working on a feature to do
+this dynamically, but it is not available yet.
+If you find this gem useful, please post your comments, bugs, patches and
+suggestions on our Github site at
10 attachment_on_the_fly.gemspec
@@ -5,11 +5,11 @@ do |s| = %q{attachment_on_the_fly}
- s.version = "0.0.5"
+ s.version = "0.0.6"
s.required_rubygems_version =">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Jeff Sutherland"]
- = %q{2009-11-22}
+ = %q{2009-11-25}
s.description = %q{A Paperclip mix-in to allow auto-generation of resized images} = %q{}
s.extra_rdoc_files = [
@@ -23,11 +23,7 @@ do |s|
- "lib/attachment_on_the_fly.rb",
- "pkg/attachment_on_the_fly-0.0.0.gem",
- "pkg/attachment_on_the_fly-0.0.1.gem",
- "pkg/attachment_on_the_fly-0.0.2.gem",
- "pkg/attachment_on_the_fly-0.0.3.gem"
+ "lib/attachment_on_the_fly.rb"
s.homepage = %q{}
s.rdoc_options = ["--charset=UTF-8"]

0 comments on commit e9e6639

Please sign in to comment.