Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 66 lines (44 sloc) 2.052 kB
b71512e @markevans RMagick encoder wasn't accepting image format as a symbol
markevans authored
1 Dragonfly
2 ===========
3
b352e83 @markevans First go at Readme and updated gem summary
markevans authored
4 Dragonfly is an on-the-fly processing/encoding framework written as a Rack application.
5 It includes an extension for Ruby on Rails to enable easy image handling.
6
7 For the lazy rails user
8 -----------------------
9
cdcbfda @markevans More concise readme and added Analysers page
markevans authored
10 environment.rb:
b352e83 @markevans First go at Readme and updated gem summary
markevans authored
11
12 config.gem 'dragonfly-rails', :lib => 'dragonfly/rails/images'
d33fa7e @markevans Added middleware_with_cache, so that we can more easily integrate int…
markevans authored
13 config.middleware.use 'Dragonfly::MiddlewareWithCache', :images
b352e83 @markevans First go at Readme and updated gem summary
markevans authored
14
15 Migration:
16
cdcbfda @markevans More concise readme and added Analysers page
markevans authored
17 add_column :albums, :cover_image_uid, :string
b352e83 @markevans First go at Readme and updated gem summary
markevans authored
18
19 Model:
20
21 class Album < ActiveRecord::Base
cdcbfda @markevans More concise readme and added Analysers page
markevans authored
22 image_accessor :cover_image # Defines reader/writer for cover_image
23 # ...
b352e83 @markevans First go at Readme and updated gem summary
markevans authored
24 end
25
26 View (for uploading via a file field):
27
28 <% form_for @album, :html => {:multipart => true} do |f| %>
29 ...
30 <%= f.file_field :cover_image %>
31 ...
32 <% end %>
33
34
35 View (to display):
36
cdcbfda @markevans More concise readme and added Analysers page
markevans authored
37 <%= image_tag @album.cover_image.url(:gif) %>
b352e83 @markevans First go at Readme and updated gem summary
markevans authored
38 <%= image_tag @album.cover_image.url('400x200') %>
d33fa7e @markevans Added middleware_with_cache, so that we can more easily integrate int…
markevans authored
39 <%= image_tag @album.cover_image.url('100x100!', :png) %>
b352e83 @markevans First go at Readme and updated gem summary
markevans authored
40 <%= image_tag @album.cover_image.url('100x100#') %>
d33fa7e @markevans Added middleware_with_cache, so that we can more easily integrate int…
markevans authored
41 <%= image_tag @album.cover_image.url('50x50+30+30sw', :tif) %>
42 <%= image_tag @album.cover_image.url(:rotate, 15) %>
b352e83 @markevans First go at Readme and updated gem summary
markevans authored
43 ...etc.
44
45 Using outside of rails, custom storage/processing/encoding/analysis, and more...
49c9fdf @markevans Updated docs with links to yard and issue tracker
markevans authored
46 --------------------------------------------------------------------------------
b352e83 @markevans First go at Readme and updated gem summary
markevans authored
47 Dragonfly is primarily a Rack app, the Rails part of it being nothing more than a separate layer on top of the main code, which means you can use it as a standalone app, or with Sinatra, Merb, etc.
48
49 It is intended to be highly customizable, and is not limited to images, but any data type that could suit on-the-fly processing/encoding.
50
49c9fdf @markevans Updated docs with links to yard and issue tracker
markevans authored
51 For more info, consult the <a href="http://yardoc.org/docs/markevans-dragonfly">DOCUMENTATION</a>
52
53 Issues
54 ======
55 Please use the <a href="http://github.com/markevans/dragonfly/issues">github issue tracker</a> if you have any issues.
56
b352e83 @markevans First go at Readme and updated gem summary
markevans authored
57
58 Credits
59 =======
60 - <a href="http://github.com/markevans">Mark Evans</a> (author)
61
62 Copyright
63 ========
64
65 Copyright (c) 2009 Mark Evans. See LICENSE for details.
Something went wrong with that request. Please try again.