@elliotthilaire
image = Dragonfly.app.fetch('gallery/angry-centipede.jpg') => <Dragonfly::Job ... > thumbnail = image.thumb('300x300').watermark => <Dragonfly::Job ... > url = thumbnail.url => "/media/W1siZiIsImZlYXR1cmVkL2FuZ3J5LWNlbnRpcGVkZS5qcGciXSxbInAiLCJ0aHVtYiI sIjMwMHgzMDAiXSxbInAiLCJ3YXRlcm1hcmsiXV0"
<Dragonfly::Job app=:default, steps=[fetch("gallery/angry-centipede.jpg"), process(:thumb, "300x300")], process(:watermark), content=<Dragonfly::Content temp_object=<Dragonfly::TempObject data="" >>, steps applied:0/3 >
require 'dragonfly' Dragonfly.app.configure do # Set a secret used to add a SHA sum to the generated URLS. secret 'I code in PHP when no one is looking.' # Load plugins plugin :imagemagick end use Dragonfly::Middleware run Sinatra::Application
rails generate dragonfly
config/initializers/dragonfly.rb
class Photo attr_accessor :image_uid # 'gallery/angry-centipede.jpg' extend Dragonfly::Model dragonfly_accessor :image ... end
... <img src="<%= @photo.image.thumb('300x200#').url %>" /> ...
Dragonfly.app.configure do ... processor :upside_down do |content, *args| content.shell_update do |old_path, new_path| "pdftk #{old_path} cat 1-endsouth output #{new_path}" end end ... end
0.9.15 (2013-05-04)
1.0.0 (2013-11-24)
Documentation: markevans.github.io/dragonfly
Blog post: www.new-bamboo.co.uk/blog/2010/01/13/dragonfly/
Wiki: https://github.com/markevans/dragonfly/wiki/Dragonfly-add-ons
Google Group: https://groups.google.com/forum/#!topic/dragonfly-users