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, 3 months ago
Versions:
