• Stars
    star
    2,116
  • Rank 21,792 (Top 0.5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created about 15 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Ruby gem for on-the-fly processing - suitable for image uploading in Rails, Sinatra and much more!

Dragonfly

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
end
<%= 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'interwebs
mp3 = wav.to_mp3  # to_mp3 is a custom processor
uid = 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

THE MAIN DOCUMENTATION IS HERE!!!

RDoc documentation is here

Installation

gem install dragonfly

or in your Gemfile

gem 'dragonfly', '~> 1.4.0'

Require with

require 'dragonfly'

Articles

See the Articles wiki for articles and tutorials.

Please feel free to contribute!!

Examples

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!!

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

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 #387 for more information.

Suggestions/Questions

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 History.md

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

Credits

Mark Evans (author) with awesome contributions from these guys

More Repositories

1

block_helpers

Block helpers for Rails views, similar to form builders but for general case.
Ruby
90
star
2

dragonfly-s3_data_store

S3 data store for the Dragonfly ruby gem
Ruby
62
star
3

partial_identifier

Plugin for rails, using jQuery, which allows you to identify rendered templates and link to them in TextMate
Ruby
18
star
4

onionjs

Onion JS. Brings tears to your eyes.
CoffeeScript
8
star
5

treehouse

Opinionated mini-framework for javascript web apps for use with React
TypeScript
8
star
6

fake_server

Command line http server for proxying HTTP requests and caching GETs, using the excellent VCR ruby gem.
Ruby
6
star
7

eventsource

Ruby
5
star
8

dragonfly-mongo_data_store

Mongo data store for Dragonfly ruby gem
Ruby
5
star
9

websocket_test

Simple drawing app for testing websockets
JavaScript
3
star
10

jquery-objectify

A useful little jquery util for making any plugin which uses (user-defined) objects
JavaScript
3
star
11

object_mapper

Ruby library for mapping arbitrary nested complex data objects into others
Ruby
3
star
12

bludgeon

Humphrey Dingburton
Shell
2
star
13

egg-js

eggs
JavaScript
2
star
14

dragonfly-rmagick

RMagick processing libraries for Dragonfly
Ruby
2
star
15

configurable

Small gem for configuring a ruby class/object
Ruby
2
star
16

persistent_scope

Extension to active_record, for making named scopes persistent (implicit in all finder calls)
Ruby
2
star
17

biscuit

Manipulate chrome cookies
Ruby
2
star
18

peerconnection

Testing peerconnection shizzle
1
star
19

k

JavaScript
1
star
20

egg-rails

yum...
JavaScript
1
star
21

hole

JavaScript
1
star
22

method_call_recorder

A small gem for recording method call chains. Can be used for e.g. funky DSLs
Ruby
1
star
23

treehouse_examples

your mum
JavaScript
1
star
24

egg

Poached, please
JavaScript
1
star