Skip to content
A Ruby gem for on-the-fly processing - suitable for image uploading in Rails, Sinatra and much more!
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
dev updated test_rails as scaffold seems to yield "form" now not "f" Dec 31, 2017
lib History/version bump Nov 13, 2018
samples make sure convert works for files with apostrophes Nov 5, 2018
tmp Add the tmp directory to the repo, and don't track anything in it Sep 6, 2011
.gitignore gitignore _site Nov 25, 2013
Gemfile We're no longer supporting Rubinius so drop conditional gem inclusion Oct 21, 2016 History/version bump Nov 13, 2018
LICENSE updated year in License Nov 24, 2013 version in readme Nov 13, 2018


Build Status

Hello!! Dragonfly is a highly customizable ruby gem for handling images and other attachments and is already in use on thousands of websites.

If you want to generate image thumbnails in Rails ...

class User < ActiveRecord::Base  # model
  dragonfly_accessor :photo
<%= image_tag'300x200#').url if @user.photo_stored? # view %>

... or generate text images on-demand in Sinatra ...

get "/:text" do |text|, text, "font-size" => 32).to_response(env)

... or just generally manage attachments in your web app ...

wav ="")  # GET from t'interwebs
mp3 = wav.to_mp3  # to_mp3 is a custom processor
uid =   # store in the configured datastore, e.g. S3

url =  # ===>

... then Dragonfly is for you! See the documentation to get started!



RDoc documentation is here


gem install dragonfly

or in your Gemfile

gem 'dragonfly', '~> 1.2.0'

Require with

require 'dragonfly'


See the Articles wiki for articles and tutorials.

Please feel free to contribute!!


See the Wiki and see the pages list for examples.

Please feel free to contribute!!

Plugins / add-ons

See the Add-ons wiki.

Please feel free to contribute!!


Please use the github issue tracker if you have any issues.

Known Issues

There are known issues when using with json gem version 1.5.2 which can potentially cause an "incorrect sha" error for files with non-ascii characters in the name. Please see for more information.


Google group dragonfly-users

Ruby Versions

See Travis-CI for tested versions.

Upgrading from v0.9 to v1.0

Dragonfly has changed somewhat since version 0.9. See the Upgrading wiki for notes on changes, and feel free to add anything you come across while upgrading!

Changes are listed in

If for whatever reason you can't upgrade, then the docs for version 0.9.x are here.


Mark Evans (author) with awesome contributions from these guys

You can’t perform that action at this time.