2011-06-20 19:05:12 +00:00
|
|
|
require 'locomotive'
|
|
|
|
|
|
|
|
unless Locomotive.engine?
|
|
|
|
|
|
|
|
require 'dragonfly'
|
|
|
|
|
|
|
|
## initialize Dragonfly ##
|
|
|
|
|
|
|
|
app = Dragonfly[:images]
|
|
|
|
app.configure_with(:rails)
|
|
|
|
app.configure_with(:imagemagick)
|
|
|
|
|
|
|
|
## configure it ##
|
|
|
|
|
|
|
|
Dragonfly[:images].configure do |c|
|
|
|
|
# Convert absolute location needs to be specified
|
|
|
|
# to avoid issues with Phusion Passenger not using $PATH
|
|
|
|
convert = `which convert`.strip.presence || "/usr/local/bin/convert"
|
|
|
|
c.convert_command = convert
|
|
|
|
c.identify_command = convert
|
|
|
|
|
|
|
|
c.allow_fetch_url = true
|
|
|
|
c.allow_fetch_file = true
|
|
|
|
|
2011-06-28 13:38:13 +00:00
|
|
|
c.url_format = '/images/dynamic/:job/:basename.:format'
|
2011-06-20 19:05:12 +00:00
|
|
|
end
|
2011-06-28 13:38:13 +00:00
|
|
|
|
2011-06-20 19:05:12 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|