public
Description: Rails plugin for uploading images as resources, with support for resizing, text stamping, and other special effects.
Home | Edit | New

OutputFormat

You don’t want to render JPGs? That’s fine. Just link to the format you want (:jpg, :gif or :png) with a formatted route, and declare the your template name to match. Fleximage will detect the desired format and and the image will be rendered properly. For instance, this will render a .gif.

# app/views/photos/show.html.erb
<%= image_tag photo_path(@photo, :gif) %>
  
# app/views/photos/show.gif.flexi
@photo.operate do |image|
  @photo.resize '150x150', :crop => true
end

This will work for :jpg, :gif or :png, although most of the time, :jpg is recommended for the best quality to filesize ratio.

Last edited by Squeegy, Sat Apr 05 13:11:22 -0700 2008
Home | Edit | New
Versions: