markevans/dragonfly
{ "createdAt": "2009-08-29T19:15:08Z", "defaultBranch": "master", "description": "A Ruby gem for on-the-fly processing - suitable for image uploading in Rails, Sinatra and much more!", "fullName": "markevans/dragonfly", "homepage": "http://markevans.github.io/dragonfly", "language": "Ruby", "name": "dragonfly", "pushedAt": "2025-01-03T10:16:36Z", "stargazersCount": 2114, "topics": [], "updatedAt": "2025-11-13T09:12:19Z", "url": "https://github.com/markevans/dragonfly"}Dragonfly
Section titled “Dragonfly”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 :photoend<%= image_tag @user.photo.thumb('300x200#').url if @user.photo_stored? # view %>… or generate text images on-demand in Sinatra …
get "/:text" do |text| Dragonfly.app.generate(:text, text, "font-size" => 32).to_response(env)end… or just generally manage attachments in your web app …
wav = Dragonfly.app.fetch_url("http://free.music/lard.wav") # GET from t'interwebsmp3 = wav.to_mp3 # to_mp3 is a custom processoruid = mp3.store # store in the configured datastore, e.g. S3
url = Dragonfly.app.remote_url_for(uid) # ===> http://s3.amazon.com/my-stuff/lard.mp3… then Dragonfly is for you! See the documentation to get started!
Documentation
Section titled “Documentation”THE MAIN DOCUMENTATION IS HERE!!!
Installation
Section titled “Installation”gem install dragonflyor in your Gemfile
gem 'dragonfly', '~> 1.4.0'Require with
require 'dragonfly'Articles
Section titled “Articles”See the Articles wiki for articles and tutorials.
Please feel free to contribute!!
Examples
Section titled “Examples”See the Wiki and see the pages list for examples.
Please feel free to contribute!!
Plugins / add-ons
Section titled “Plugins / add-ons”See the Add-ons wiki.
Please feel free to contribute!!
Security notice!
Section titled “Security notice!”If you have set verify_urls to false (which is not recommended) then you should upgrade to version 1.4.x for a security fix (CVE-2021-33564).
Issues
Section titled “Issues”Please use the github issue tracker if you have any issues.
Known Issues
Section titled “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 https://github.com/markevans/dragonfly/issues/387 for more information.
Suggestions/Questions
Section titled “Suggestions/Questions”Ruby Versions
Section titled “Ruby Versions”See Travis-CI for tested versions.
Upgrading from v0.9 to v1.0
Section titled “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 History.md
If for whatever reason you can’t upgrade, then the docs for version 0.9.x are here.
Credits
Section titled “Credits”Mark Evans (author) with awesome contributions from these guys