Thumbnail Generation · thoughtbot/paperclip Wiki. Common use cases for thumbnails are pretty easy with Paperclip. You define your preferred sizes in your initial has_attached_file call: Then you use them like this: :styles also accepts a lambda, enabling you to access the instance being operated on: Resizing options Default behavior is to resize the image and maintain aspect ratio (i.e. the :medium version of a 300×150 image will be 200×100). Trailing #, thumbnail will be centrally cropped, ensuring the requested dimensions. trailing >, thumbnail will only be modified if it is currently larger requested dimensions.
You can see a complete list of ImageMagick options for more. Optimizing thumbnails for the web If you’re creating thumbnails for heavy images, you can greatly reduce sizes for your thumbnails by stripping EXIF data and controlling compression options. Check out the -strip, -quality and -thumbnail options from ImageMagick’s options. Here’s an example on how to apply these flags to your thumbnails: rake paperclip:refresh CLASS=User. Ruby on rails - Carrierwave - Resizing images to fixed width. Thoughtbot/paperclip. #134 Paperclip. Need to add image attachments to a model? See how with paperclip in this episode. Download: source codeProject Files in Zip (150 KB)mp4Full Size H.264 Video (11.5 MB)m4vSmaller H.264 Video (7.81 MB)webmFull Size VP8 Video (20.3 MB)ogvFull Size Theora Video (15.3 MB)
Bastiaanterhorst/rich. Markevans/dragonfly. #253 CarrierWave File Uploads. CarrierWave makes it easy and clean to add file uploads to your application. It supports a variety of ORMs, frameworks and image processors. Download: source codeProject Files in Zip (480 KB)mp4Full Size H.264 Video (21 MB)m4vSmaller H.264 Video (11.7 MB)webmFull Size VP8 Video (24.9 MB)ogvFull Size Theora Video (25.4 MB) Jnicklas/carrierwave. Justinfrench/formtastic.