Giter Site home page Giter Site logo

markevans / dragonfly Goto Github PK

View Code? Open in Web Editor NEW
2.1K 29.0 244.0 6.57 MB

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

Home Page: http://markevans.github.io/dragonfly

License: MIT License

Ruby 99.82% HTML 0.18%

dragonfly's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.