Code Monkey home page Code Monkey logo

dragonfly's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dragonfly's Issues

S3_BUCKET: NameError (uninitialized constant Dragonfly::Delegator)

Just to let you know, I experienced this uninitialized constant error, setting up an application which use Amazon S3 datastore.

I found out that there's a related problem with buckets created in Europe. After creating a bucket in the US everything started to work fine.

I repeated the operation three times and always experienced the same "uninitialized constant Dragonfly::Delegator" when my amazon s3 bucket is created in Irland ....

That's all I know, for me this thread is not related to Dragonfly, possibly could be releted to aws-s3 (0.6.2) and buckets created in Europe, don't know.

[BUG] Fail when uploading a file with the same name of a previous file uploaded

Hi.

I have this model:


class Clothe
  include Mongoid::Document
  field :gender
  field :icon_uid
  field :image_uid
  image_accessor :icon
  image_accessor :image
  validates_presence_of :gender, :icon, :image  
end

Supose that I've uploaded a file named "flute.png" for the icon field. Everything works fine. But for some reason I need to update this field in order to upload a NEW version of "flute.png" (for example, the designer decided to paint it red). Since I'm uploading a file with the name "flute.png" again, the image is not updated, it's still the first version of "flute.png".

Is it a cache problem or anything like that?

Thanks.

Problem with Passenger?

When running app under passenger A have error:
Processing ApplicationController#index (for 188.35.19.7 at 2010-10-20 10:47:54) [GET]

ActionController::RoutingError (No route matches "/media/BAhbB1sHOgZmIhoyMDEwLzEwLzE0L2dyb3VwMi5qcGdbCDoGcDoKdGh1bWIiDTE3NXgxNzU+" with {:method=>:get}):
dragonfly (0.7.6) lib/dragonfly/middleware.rb:16:in `call'
passenger (3.0.0) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.0) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
passenger (3.0.0) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.0) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
passenger (3.0.0) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
passenger (3.0.0) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
passenger (3.0.0) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.0) lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.0) lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
passenger (3.0.0) lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
passenger (3.0.0) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.0) lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
passenger (3.0.0) lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
passenger (3.0.0) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.0) lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
passenger (3.0.0) lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
passenger (3.0.0) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.0) helper-scripts/passenger-spawn-server:99

I'm using: dragonfly 0.7.6, ruby 1.8.7 (2010-04-19 patchlevel 253) , passenger 3.0.0.

Everything works just fine when running under mongrel (save environment!) on a single port.

What's problem?

Dragonfly does not play well with ActiveRecord STI in complex cases

I'm having trouble in the following STI case:

class MyBase < ActiveRecord::Base
  image_accessor :photo
end

class MyRecord < MyBase
  include AnotherModule

  # ... accessing photo here causes "to_value called on nil" errors
end

It appears that in lib/dragonfly/active_record_extensions/class_methods.rb, the inheritance only traverses one step in the inheritance hierarchy and reaches AnotherModule and not MyBase. Using class_inheritable_hash would probably be the better solution in this case.

I have temporarily fixed my app as follows (in initializers/dragonfly.rb)

require 'dragonfly/rails/images'
ActiveRecord::Base.class_inheritable_hash :dragonfly_apps_for_attributes
ActiveRecord::Base.dragonfly_apps_for_attributes = {}

Model not getting it's image_accessor loaded sometimes

The first time I hit a page with the images they show up fine but any subsequent time I get undefined method blob for Image. The model is called Image and the image_accessor :blob. It's looking up a collection of images for a gallery. Any Ideas?

Using Rails 3, Passenger 2.2.11, Dragonfly 0.6.1

URLs shown until image is loaded

This isn't really an issue, but more of an aesthetics thing. I notice than when I first load a set of thumbnails for the first time for the brief second before the images are shown, in their place is the url to the image

e.g.
/media/BAhbB1sHOgZmIjAyMDExLzAzLzMxLzAxXzA2XzIyXzEwMV9Eb2trZW5FeHRlcmlvcjYuanBnWwg6BnA6CnRodW1iIgs3NXg1MCM

Is there a way to hide this until the image is loaded? I'm sure I could put a loading gif or something in it's place, but I thought I'd ask if someone had a solution that didn't require some sort of javascript to hide these links.

Thanks in advance, and I'm loving dragonfly!

Datamapper support

Dragonfly doesn't support datamapper - this is mainly just a placeholder for me to remember

Set :convert_command and :identify_command in Rails initializers

Hello,

I was receiving this error on image uploads with imagemagick installed:
No such file or directory - identify /tmp/RackMultipart20110113-42747-bojia4

I fixed the issue by overriding the :convert_command and :identify_command values in lib/dragonfly/image_magick_utils.rb, Here is the change I made: https://gist.github.com/3b98e75cea9f5c03f472

If I could set this in my Rails initializers, it would be great. How can I set these attributes without hardcoding the values into the gem?

Any help would be much appreciated.

Best,
Dan

downloading a remote image - fail under certain conditions

using open-uri to download and save a remote image using dragonfly:

say we have

profile = Profile.new
profile.profile_image("http://example.com/images/test.png")
=> #File:/var/folders/d4/-Tmp-/open-uri20100812-11976-14f5rtp-0

// this works as should and creates a file object which can be used with dragonfly

// unfortunately when we try to do the same with a small Jpeg

profile = Profile.new
profile.profile_image("http://example.com/images/test.jpg")
=> #StringIO:0x1030b93a8 ArgumentError: Dragonfly::ExtendedTempObject must be initialized with a String, a File, a Tempfile, or another TempObject

// I think the issue may be with openuri and small Jpeg files >10K, if the files are small enough a StringIO object is created and not a file object which can be used in Dragonfly

its an error that took me a while to figure out...thought id reproduce here

of course the easiest way to get into dragonfly in to convert StringIO into a string

Dragonfly does not work with Passenger Standalone/Passenger nginx

This is a reminder for this issue, which is related to using DragonFly with Passenger on nginx (Passenger Standalone is also affected because its core is based on nginx).

http://groups.google.com/group/dragonfly-users/browse_thread/thread/599d0ede0af30a01/82cabab1e1736102?lnk=gst&q=passenger#82cabab1e1736102

Thanks to Steve England, the current workaround is to add this route in routes.rb :

match '/media/*dragonfly', :to => Dragonfly[:images]

Encoded URLs incompatible with non-Ruby clients

We were hoping to setup Dragonfly to allow trusted partners to request image sizes on-demand, but not all (none) of our partners use Ruby and the Dragonfly URL encoding depends on an implementation of Ruby's marshal algorithm. This algorithm isn't always compatible across versions of Ruby so the URL encoding using Marshal could even cause problems between Ruby apps if they run different versions of Ruby.

I would want a URL syntax that was straight-forward to implement on non-Ruby clients, including client-side JavaScript if DOS protection is disabled.

Crashes when trying to generate a thumb

When calling '@project.picture.thumb('100x100#').url' I get the following stack trace.

$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]

Gems:
rmagick (2.13.1)
dragonfly (0.7.4)

using ImageMagick-6.6.3-9

-- control frame ----------
c:0065 p:---- s:0345 b:0345 l:000344 d:000344 CFUNC :from_blob
c:0064 p:0027 s:0341 b:0341 l:000340 d:000340 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/r_magick_utils.rb:7
c:0063 p:0017 s:0332 b:0332 l:001928 d:001928 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/processing/r_magick_processor.rb:72
c:0062 p:0128 s:0327 b:0327 l:000326 d:000326 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/processing/r_magick_processor.rb:97
c:0061 p:---- s:0322 b:0322 l:000321 d:000321 FINISH
c:0060 p:---- s:0320 b:0320 l:000319 d:000319 CFUNC :call
c:0059 p:0014 s:0315 b:0315 l:000298 d:000314 BLOCK /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/function_manager.rb:37
c:0058 p:---- s:0313 b:0313 l:000312 d:000312 FINISH
c:0057 p:---- s:0311 b:0311 l:000310 d:000310 CFUNC :catch
c:0056 p:0011 s:0307 b:0307 l:000298 d:000306 BLOCK /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/function_manager.rb:36
c:0055 p:---- s:0304 b:0304 l:000303 d:000303 FINISH
c:0054 p:---- s:0302 b:0302 l:000301 d:000301 CFUNC :each
c:0053 p:0054 s:0299 b:0299 l:000298 d:000298 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/function_manager.rb:35
c:0052 p:0017 s:0294 b:0294 l:000293 d:000293 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/processor.rb:5
c:0051 p:0091 s:0288 b:0285 l:000284 d:000284 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/job.rb:67
c:0050 p:0012 s:0280 b:0280 l:000271 d:000279 BLOCK /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/job.rb:214
c:0049 p:---- s:0277 b:0277 l:000276 d:000276 FINISH
c:0048 p:---- s:0275 b:0275 l:000274 d:000274 CFUNC :each
c:0047 p:0017 s:0272 b:0272 l:000271 d:000271 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/job.rb:214
c:0046 p:0011 s:0269 b:0269 l:000268 d:000268 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/job.rb:220
c:0045 p:0022 s:0266 b:0264 l:000263 d:000263 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/endpoint.rb:37
c:0044 p:0049 s:0260 b:0259 l:000258 d:000258 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/endpoint.rb:12
c:0043 p:0160 s:0253 b:0253 l:000252 d:000252 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/simple_endpoint.rb:23
c:0042 p:0025 s:0246 b:0246 l:000245 d:000245 METHOD /home/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/forwardable.rb:182
c:0041 p:0097 s:0241 b:0241 l:000213 d:000240 BLOCK /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-mount-0.6.12/lib/rack/mount/route_set.rb:148
c:0040 p:0014 s:0235 b:0235 l:000219 d:000234 BLOCK /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-mount-0.6.12/lib/rack/mount/code_generation.rb:93
c:0039 p:0142 s:0230 b:0230 l:000229 d:000229 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-mount-0.6.12/lib/rack/mount/code_generation.rb:68
c:0038 p:0259 s:0220 b:0220 l:000219 d:000219 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-mount-0.6.12/lib/rack/mount/code_generation.rb:92
c:0037 p:0092 s:0214 b:0214 l:000213 d:000213 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-mount-0.6.12/lib/rack/mount/route_set.rb:139
c:0036 p:0025 s:0208 b:0208 l:000207 d:000207 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/routing/route_set.rb:489
c:0035 p:0032 s:0204 b:0204 l:000203 d:000203 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/bullet-2.0.0.rc1/lib/bullet/rack.rb:8
c:0034 p:0093 s:0196 b:0196 l:000195 d:000195 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/head.rb:14
c:0033 p:0155 s:0189 b:0189 l:000188 d:000188 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/methodoverride.rb:24
c:0032 p:0046 s:0183 b:0183 l:000182 d:000182 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/params_parser.rb:21
c:0031 p:0054 s:0178 b:0178 l:000177 d:000177 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/flash.rb:177
c:0030 p:0027 s:0171 b:0171 l:000170 d:000170 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/session/abstract_store.rb:149
c:0029 p:0015 s:0160 b:0160 l:000159 d:000159 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/cookies.rb:268
c:0028 p:0014 s:0152 b:0152 l:000ec0 d:000151 BLOCK /home/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.0.rc/lib/active_record/query_cache.rb:32
c:0027 p:0019 s:0150 b:0150 l:000149 d:000149 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.0.rc/lib/active_record/connection_adapters/abstract/query_cache.rb:28
c:0026 p:0051 s:0146 b:0146 l:000145 d:000145 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.0.rc/lib/active_record/query_cache.rb:12
c:0025 p:0019 s:0142 b:0142 l:000ec0 d:000ec0 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.0.rc/lib/active_record/query_cache.rb:31
c:0024 p:0029 s:0138 b:0138 l:000aa0 d:000137 BLOCK /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/callbacks.rb:46
c:0023 p:0155 s:0136 b:0136 l:000135 d:000135 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0.rc/lib/active_support/callbacks.rb:410
c:0022 p:0011 s:0126 b:0126 l:000aa0 d:000aa0 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/callbacks.rb:44
c:0021 p:0015 s:0122 b:0122 l:000121 d:000121 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/sendfile.rb:107
c:0020 p:0049 s:0112 b:0112 l:000111 d:000111 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/remote_ip.rb:48
c:0019 p:0015 s:0108 b:0108 l:000107 d:000107 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/show_exceptions.rb:48
c:0018 p:0027 s:0100 b:0100 l:000099 d:000099 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0.rc/lib/rails/rack/logger.rb:13
c:0017 p:0032 s:0096 b:0096 l:000095 d:000095 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/runtime.rb:17
c:0016 p:0052 s:0087 b:0087 l:000086 d:000086 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0.rc/lib/active_support/cache/strategy/local_cache.rb:72
c:0015 p:0014 s:0083 b:0083 l:000077 d:000082 BLOCK /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/lock.rb:11
c:0014 p:0019 s:0081 b:0081 l:000080 d:000080 METHOD internal:prelude:10
c:0013 p:0054 s:0078 b:0078 l:000077 d:000077 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/lock.rb:11
c:0012 p:0193 s:0073 b:0073 l:000072 d:000072 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/static.rb:30
c:0011 p:0032 s:0066 b:0066 l:000065 d:000065 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0.rc/lib/rails/application.rb:168
c:0010 p:0021 s:0062 b:0062 l:000061 d:000061 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0.rc/lib/rails/application.rb:77
c:0009 p:---- s:0057 b:0057 l:000056 d:000056 FINISH
c:0008 p:0015 s:0055 b:0055 l:000054 d:000054 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0.rc/lib/rails/rack/log_tailer.rb:15
c:0007 p:0015 s:0050 b:0050 l:000049 d:000049 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/content_length.rb:13
c:0006 p:0338 s:0042 b:0042 l:000041 d:000041 METHOD /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/handler/webrick.rb:52
c:0005 p:0257 s:0030 b:0030 l:000029 d:000029 METHOD /home/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:111
c:0004 p:0393 s:0020 b:0020 l:000019 d:000019 METHOD /home/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:70
c:0003 p:0126 s:0009 b:0009 l:001d08 d:000008 BLOCK /home/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/server.rb:183
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH

c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP

-- Ruby level backtrace information ----------------------------------------
/home/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/server.rb:183:in block in start_thread' /home/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:70:inrun'
/home/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:111:in service' /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/handler/webrick.rb:52:inservice'
/home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/content_length.rb:13:in call' /home/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0.rc/lib/rails/rack/log_tailer.rb:15:incall'
/home/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0.rc/lib/rails/application.rb:77:in method_missing' /home/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0.rc/lib/rails/application.rb:168:incall'
/home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/static.rb:30:in call' /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/lock.rb:11:incall'
internal:prelude:10:in synchronize' /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/lock.rb:11:inblock in call'
/home/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0.rc/lib/active_support/cache/strategy/local_cache.rb:72:in call' /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/runtime.rb:17:incall'
/home/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0.rc/lib/rails/rack/logger.rb:13:in call' /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/show_exceptions.rb:48:incall'
/home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/remote_ip.rb:48:in call' /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/sendfile.rb:107:incall'
/home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/callbacks.rb:44:in call' /home/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0.rc/lib/active_support/callbacks.rb:410:in_run_call_callbacks'
/home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/callbacks.rb:46:in block in call' /home/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.0.rc/lib/active_record/query_cache.rb:31:incall'
/home/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.0.rc/lib/active_record/query_cache.rb:12:in cache' /home/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.0.rc/lib/active_record/connection_adapters/abstract/query_cache.rb:28:incache'
/home/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.0.rc/lib/active_record/query_cache.rb:32:in block in call' /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/cookies.rb:268:incall'
/home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/session/abstract_store.rb:149:in call' /home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/flash.rb:177:incall'
/home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/params_parser.rb:21:in call' /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/methodoverride.rb:24:incall'
/home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/middleware/head.rb:14:in call' /home/.rvm/gems/ruby-1.9.2-p0/gems/bullet-2.0.0.rc1/lib/bullet/rack.rb:8:incall'
/home/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.0.rc/lib/action_dispatch/routing/route_set.rb:489:in call' /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-mount-0.6.12/lib/rack/mount/route_set.rb:139:incall'
/home/.rvm/gems/ruby-1.9.2-p0/gems/rack-mount-0.6.12/lib/rack/mount/code_generation.rb:92:in recognize' /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-mount-0.6.12/lib/rack/mount/code_generation.rb:68:inoptimized_each'
/home/.rvm/gems/ruby-1.9.2-p0/gems/rack-mount-0.6.12/lib/rack/mount/code_generation.rb:93:in block in recognize' /home/.rvm/gems/ruby-1.9.2-p0/gems/rack-mount-0.6.12/lib/rack/mount/route_set.rb:148:inblock in call'
/home/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/forwardable.rb:182:in call' /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/simple_endpoint.rb:23:incall'
/home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/endpoint.rb:12:in response_for_job' /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/endpoint.rb:37:insuccess_headers'
/home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/job.rb:220:in result' /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/job.rb:214:inapply'
/home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/job.rb:214:in each' /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/job.rb:214:inblock in apply'
/home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/job.rb:67:in apply' /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/processor.rb:5:inprocess'
/home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/function_manager.rb:35:in call_last' /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/function_manager.rb:35:ineach'
/home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/function_manager.rb:36:in block in call_last' /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/function_manager.rb:36:incatch'
/home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/function_manager.rb:37:in block (2 levels) in call_last' /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/function_manager.rb:37:incall'
/home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/processing/r_magick_processor.rb:97:in thumb' /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/processing/r_magick_processor.rb:72:inresize_and_crop'
/home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/r_magick_utils.rb:7:in rmagick_image' /home/.rvm/gems/ruby-1.9.2-p0/gems/dragonfly-0.7.4/lib/dragonfly/r_magick_utils.rb:7:infrom_blob'

-- C level backtrace information -------------------------------------------

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort trap

Conditional GET

I believe dragonfly should return a 304 with an empty body when it receives a request with an If-None-Matches header where the ETag hasn't changed.

I can contribute this.

downloading a remote image - fail under certain conditions

using open-uri to download and save a remote image using dragonfly:

say we have

profile = Profile.new
profile.profile_image("http://example.com/images/test.png")
=> #File:/var/folders/d4/-Tmp-/open-uri20100812-11976-14f5rtp-0

// this works as should and creates a file object which can be used with dragonfly

// unfortunately when we try to do the same with a small Jpeg

profile = Profile.new
profile.profile_image("http://example.com/images/test.png")
=> #StringIO:0x1030b93a8
ArgumentError: Dragonfly::ExtendedTempObject must be initialized with a String, a File, a Tempfile, or another TempObject

// I think the issue may be with openuri and small Jpeg files >10K, if the files are small enough a StringIO object is created and not a file object which can be used in Dragonfly

its an error that took me a while to figure out...thought id reproduce here

of course the easiest way to get into dragonfly in to convert StringIO into a string

Issue uploading

So far it seems to not be correctly uploading the attachments. It saves it as a file with the file name in the file.

example... Uploading image.jpg uploads to system/dragonfly/development/2010/04/04/1234_file with 1234_file.jpg written in the file.

I also started getting the "no decode delegate for this image format", but that was due to the files not being images I've concluded. Replaced the files with the actual images, renaming them to the file names and removing the extension, sure enough it works...

I'm on a Mac OS X, using Rails 3.0...

Any guidance on this?

IOError

Hello.
DragonFly 0.7.6, ruby 1.8.7 p299, rails3
The following error is happening IOError Closed Stream.
I don't know why.

How to stub out the call to S3 when running rspec or cucumber?

How can I stub out the call to S3 when testing or running cucumber with Factory? Running in Rails3.

initializers/dragonfly.rb

raw_config = File.read("#{Rails.root}/config/app_config.yml")
APP_CONFIG = YAML.load(raw_config)[Rails.env].symbolize_keys

require 'dragonfly/rails/images'

app = Dragonfly::App[:images]
app.configure_with(Dragonfly::Config::RMagickImages)
app.configure_with(Dragonfly::Config::RailsDefaults) do |c|
  c.datastore = Dragonfly::DataStorage::S3DataStore.new
  c.datastore.configure do |d|
    d.bucket_name = APP_CONFIG[:bucket]
    d.access_key_id = APP_CONFIG[:access_key_id]
    d.secret_access_key = APP_CONFIG[:secret_access_key]
  end
  c.url_handler.path_prefix = '/photos'
end

Factory

Factory.define :thing do |f|
  f.title Faker::Lorem.words(4)
  f.description Faker::Lorem.paragraph(1)
  f.thing_image File.new(Rails.root + "spec/fixtures/pahadganj.jpg")
end

Everytime I run the feature or rspec test, that fixture file is always sent to S3 and it makes it slow as well??

Mongoid support

I tried installing this gem on my Mongoid project, but restarting the server failed with some errors pointing to an ActiveRecord dependency. Was this a fluke or is Mongoid not supported yet?

Edit: here is the error message

  /../gems/dragonfly-0.8.2/lib/dragonfly/rails/images.rb:11:in `<top (required)>': uninitialized constant ActiveRecord (NameError)
from /Users/newuser/Dropbox/Sites/rails/salvagr/config/initializers/dragonfly.rb:2:in `<top (required)>'

Invoking rake spec on the project fails

This is after cloning the latest (0.7.5):

(antwerp@hanzo:dragonfly)
$ rake spec

(in /Users/antwerp/Code/opensource/dragonfly)
/Users/antwerp/.gem/ruby/18/gems/bundler-1.0.0/lib/bundler/runtime.rb:27:in setup': You have already activated gemcutter 0.5.0, but your Gemfile requires gemcutter 0.6.1. Consider using bundle exec. (Gem::LoadError) from /Users/antwerp/.gem/ruby/18/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:ineach'
from /Users/antwerp/.gem/ruby/18/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in each' from /Users/antwerp/.gem/ruby/18/gems/bundler-1.0.0/lib/bundler/runtime.rb:17:insetup'
from /Users/antwerp/.gem/ruby/18/gems/bundler-1.0.0/lib/bundler.rb:100:in setup' from /Users/antwerp/.gem/ruby/18/gems/bundler-1.0.0/lib/bundler/cli.rb:324:inexec'
from /Users/antwerp/.gem/ruby/18/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in send' from /Users/antwerp/.gem/ruby/18/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:inrun'
from /Users/antwerp/.gem/ruby/18/gems/bundler-1.0.0/lib/bundler/vendor/thor/invocation.rb:118:in invoke_task' from /Users/antwerp/.gem/ruby/18/gems/bundler-1.0.0/lib/bundler/vendor/thor.rb:246:indispatch'
from /Users/antwerp/.gem/ruby/18/gems/bundler-1.0.0/lib/bundler/vendor/thor/base.rb:389:in start' from /Users/antwerp/.gem/ruby/18/gems/bundler-1.0.0/bin/bundle:13 from /Users/antwerp/.gem/ruby/18/bin/bundle:19:inload'
from /Users/antwerp/.gem/ruby/18/bin/bundle:19

Quality loss on thumbnails

Hello there,

I really like Dragonfly alot. The only downside at the moment is the loss of quality on generated thumbnails. Is there a way to specify -quality in an options hash or alike?

Kind regards,
Marian

TypeError when using ActiveScafold

I'm trying to have an active_scafold view over a model that contains a string and an image. However whatever I do I get stuck on the following error

TypeError (can't convert Symbol into String):
app/controllers/admin/original_images_controller.rb:5
dragonfly (0.7.6) lib/dragonfly/middleware.rb:16:in `call'
/usr/lib/ruby/1.8/mongrel.rb:159:in `process_client'
/usr/lib/ruby/1.8/mongrel.rb:158:in `each'
/usr/lib/ruby/1.8/mongrel.rb:158:in `process_client'
/usr/lib/ruby/1.8/mongrel.rb:285:in `run'
/usr/lib/ruby/1.8/mongrel.rb:285:in `initialize'
/usr/lib/ruby/1.8/mongrel.rb:285:in `new'
/usr/lib/ruby/1.8/mongrel.rb:285:in `run'
/usr/lib/ruby/1.8/mongrel.rb:268:in `initialize'
/usr/lib/ruby/1.8/mongrel.rb:268:in `new'
/usr/lib/ruby/1.8/mongrel.rb:268:in `run'
-e:2:in `load'
-e:2

any idea of what is going on ?

Why does dragonfly configured with s3 still show a system path?

The nice thing about s3 is that the loading of image assets gets offloaded from your servers to amazon. In addition, one could configure cloudfront and get an ok cdn for the images.

Why does dragonfly use the /system/hash/file.png to route to s3 instead of having image.url give back the s3 path?

Feature request: filename in URL

By default dragonfly urls don't end with an extension for the file they are representing e.g.:
/assets/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw

This causes things like lightbox scripts to fail because they are looking for extensions.

A better URL is something like this:

/system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw/image_name.jpg

We have managed to achieve this in Refinery CMS using this wee instance_eval:
http://github.com/resolve/refinerycms/blob/master/vendor/refinerycms/images/lib/images.rb#L48-L62

It'd be nice to have core support for this, maybe as an option passed to the dragonfly configuration that puts the filename at the end by default. As it is, we have to get it using the job.steps where we look for one with step_name :fetch.

Crash from somewhere with dragonfly behind RefineryCMS

I was pointed to post this here: [from http://github.com/resolve/refinerycms/issues#issue/212]

Using Rails 3, Ruby 1.9.2

I get a massive crash that looks like its coming from ImageMagick or one of its dep libraries. No idea where this is coming from. Installed everything following the instructs on the Installation wiki.

The stack trace is here:
http://gist.github.com/586270

Images won't load with Ruby 1.9.2 and Rails 3

I realise this might not happen to everybody but it happens for me, Images that have yet to have be generated fail to be created in a production environment with rails 3 and ruby 1.9.2 yet everything is fine in development.

Development environment running on Mac OSX with ruby 1.9.2-p0 built via rvm;
Production environment running on Ubuntu 10.04LTS with ruby 1.9.2-p0 compiled from source.

I tracked this problem down to an encoding error happening in the temp object creation stuff,

Read error: #
/dragonfly-0.7.5/lib/dragonfly/temp_object.rb:60:in `tempfile'

and was thus able to replicate it on rails console with

file = Tempfile.new('dragonfly')
file.write "\xFF".force_encoding("ASCII-8BIT")

To solve the issue I used this patch : http://gist.github.com/573842

dragonfly 0.7.6 shortcut issue with gravity

If I'm using dragonfly 0.7.5 I don't have this issue. If I I'm using 0.7.6, images defined using a shortcut with gravity in the config will fail to load. Remove the gravity line and restart the server and all is well again (except my images aren't output the way I want them).

app.configure do |c|
  c.job :sidebar do
    process :resize_and_crop, :width => 270, :height => 92, :gravity => 'n'
    encode  :jpg
  end
end

rails master + dragonfly master produces error

/home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/dragonfly-efba1ef9b321/lib/dragonfly/middleware.rb:4:in `initialize': wrong number of arguments (3 for 2) (ArgumentError)
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/actionpack/lib/action_dispatch/middleware/stack.rb:43:in `new'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/actionpack/lib/action_dispatch/middleware/stack.rb:43:in `build'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/actionpack/lib/action_dispatch/middleware/stack.rb:112:in `block in build'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/actionpack/lib/action_dispatch/middleware/stack.rb:112:in `each'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/actionpack/lib/action_dispatch/middleware/stack.rb:112:in `inject'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/actionpack/lib/action_dispatch/middleware/stack.rb:112:in `build'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/engine.rb:416:in `app'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/application/finisher.rb:37:in `block in '
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/initializable.rb:25:in `instance_exec'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/initializable.rb:25:in `run'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/initializable.rb:50:in `block in run_initializers'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/initializable.rb:49:in `each'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/initializable.rb:49:in `run_initializers'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/application.rb:93:in `initialize!'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/railtie/configurable.rb:28:in `method_missing'
    from /home/user/testapp/config/environment.rb:5:in `'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/activesupport/lib/active_support/dependencies.rb:237:in `require'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/activesupport/lib/active_support/dependencies.rb:237:in `block in require'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/activesupport/lib/active_support/dependencies.rb:223:in `block in load_dependency'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/activesupport/lib/active_support/dependencies.rb:639:in `new_constants_in'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/activesupport/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/activesupport/lib/active_support/dependencies.rb:237:in `require'
    from /home/user/testapp/config.ru:3:in `block in '
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rack-2f92be21302d/lib/rack/builder.rb:46:in `instance_eval'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rack-2f92be21302d/lib/rack/builder.rb:46:in `initialize'
    from /home/user/testapp/config.ru:1:in `new'
    from /home/user/testapp/config.ru:1:in `'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rack-2f92be21302d/lib/rack/builder.rb:35:in `eval'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rack-2f92be21302d/lib/rack/builder.rb:35:in `parse_file'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rack-2f92be21302d/lib/rack/server.rb:170:in `app'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/commands/server.rb:46:in `app'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rack-2f92be21302d/lib/rack/server.rb:267:in `wrapped_app'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rack-2f92be21302d/lib/rack/server.rb:218:in `start'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/commands/server.rb:69:in `start'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/commands.rb:51:in `block in '
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/commands.rb:46:in `tap'
    from /home/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/rails-eb8beb32b072/railties/lib/rails/commands.rb:46:in `'
    from script/rails:6:in `require'
    from script/rails:6:in `'

Does dragonfly supports nested forms?

Hi,

I have two models:

class Closet
include Mongoid::Document
field :gender, :type => String
embeds_many :clothes
accepts_nested_attributes_for :clothes
end

class Clothe
include Mongoid::Document
embedded_in :closet, :inverse_of => :clothe
field :thumb_uid
image_accessor :thumb
field :image_uid
image_accessor :image
end

And I'm using a nested form (app/views/closets/_form.html.erb):

<%= form_for(@Closet, :html => {:multipart => true}) do |f| %>
<% if @closet.errors.any? %>


<%= pluralize(@closet.errors.count, "error") %> prohibited this closet from being saved:

  <ul>
  <% @closet.errors.full_messages.each do |msg| %>
    <li><%= msg %></li>
  <% end %>
  </ul>
</div>

<% end %>

<%= f.label :gender %>
<%= f.text_field :gender %>

<% f.fields_for :clothes do |builder| %>


<%= builder.label :thumb, "Thumb"%>
<%= builder.file_field :thumb %>



<%= builder.label :image, "Image"%>
<%= builder.file_field :image %>


<% end %>

<%= f.submit %>
<% end %>

The point is, the images of "Clothe" model does not get saved!

Am I doing something wrong?

Thanks!

I18n for validation errors

I'd like to translate the validation error message to spanish. I know I can provide a custom message, but I'd like to have access to variables such as the property, its value, the allowed values, ... Right now it isn't simple as far as I can see.

Using I18n for these messages sounds like the perfect solution.

Thanks!

unable to view images in Firefox 3.5.0.9 on Win XP

I built an app with dragonfly 0.8.2 on Rails 3.0.3 and ruby 1.8.7. When I try to view any uploaded image or thumbnail with Firefox 3.0.19 on windows Xp I get only the long images uids. Nothing displayed at all.

Everything goes WELL with:
safari 5x on os x 10.6
ff 3.6 on os x
Chrome on Win 7
Chrome on Win Xp
ff 3.6 on Win xp
IE 8.0.6001 su win xp.

By the way the buggy 3.0.19 ff version doesn't have any problem with other websites.

Do you know if there is any FF extension that could cause problems with the images generated by dragonfly? The version that doesn't work has: download helper
and abduction! .

Error when using S3

I'm using S3 and Heroku, and I get the error below when saving a model. The config vars are set up, and the bucket exists -- I can't figure out what's happening to cause this error.

ProfilesController# (NoMethodError) "undefined method `name' for #AWS::S3::Bucket:0x000000063abe88"

/app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/bundler/gems/dragonfly-9a9c919/lib/dragonfly/data_storage/s3data_store.rb:69:in block in bucket_names' /app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/bundler/gems/dragonfly-9a9c919/lib/dragonfly/data_storage/s3data_store.rb:69:inmap'
/app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/bundler/gems/dragonfly-9a9c919/lib/dragonfly/data_storage/s3data_store.rb:69:in bucket_names' /app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/bundler/gems/dragonfly-9a9c919/lib/dragonfly/data_storage/s3data_store.rb:31:increate_bucket!'
/app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/bundler/gems/dragonfly-9a9c919/lib/dragonfly/data_storage/s3data_store.rb:75:in ensure_initialized' /app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/bundler/gems/dragonfly-9a9c919/lib/dragonfly/data_storage/s3data_store.rb:36:instore'
/app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/bundler/gems/dragonfly-9a9c919/lib/dragonfly/app.rb:102:in store' /app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/bundler/gems/dragonfly-9a9c919/lib/dragonfly/job.rb:352:instore'
/app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/bundler/gems/dragonfly-9a9c919/lib/dragonfly/active_model_extensions/attachment.rb:51:in save!' /app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/bundler/gems/dragonfly-9a9c919/lib/dragonfly/active_model_extensions/instance_methods.rb:16:inblock in save_dragonfly_attachments'
/app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/bundler/gems/dragonfly-9a9c919/lib/dragonfly/active_model_extensions/instance_methods.rb:15:in each' /app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/bundler/gems/dragonfly-9a9c919/lib/dragonfly/active_model_extensions/instance_methods.rb:15:insave_dragonfly_attachments'
/app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:414:in _run_save_callbacks' /app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/callbacks.rb:277:increate_or_update'
/app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/persistence.rb:39:in save' /app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/validations.rb:43:insave'
/app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/attribute_methods/dirty.rb:21:in save' /app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:237:inblock (2 levels) in save'
/app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:289:in block in with_transaction_returning_status' /app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:139:intransaction'
/app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:204:in transaction' /app/0ba626d2-2013-4a37-98b9-f31d89717934/home/vendor/plugins/rpm/lib/new_relic/agent/method_tracer.rb:319:inblock in transaction_with_trace_ActiveRecord_self_name_transaction'
/app/0ba626d2-2013-4a37-98b9-f31d89717934/home/vendor/plugins/rpm/lib/new_relic/agent/method_tracer.rb:141:in trace_execution_scoped' /app/0ba626d2-2013-4a37-98b9-f31d89717934/home/vendor/plugins/rpm/lib/new_relic/agent/method_tracer.rb:314:intransaction_with_trace_ActiveRecord_self_name_transaction'
/app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:287:in with_transaction_returning_status' /app/0ba626d2-2013-4a37-98b9-f31d89717934/home/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/transactions.rb:237:inblock in save'

rails asset hosts 404

When I enable asset hosts with rails, the images generated by dragonfly result in 404 errors.
(Rails 3)
I have this in my production block:
config.action_controller.asset_host = "http://media%d.mydomain.com"
So rails will use one of four asset hosts.

Is dragonfly some how tying my images to the original domain?

Height and Width speed up

right now image.thumb('150x100').width (or height) takes about 3 second to execute. can it be speed up a bit?

Problem with TempFiles

Dragonfly does not delete the files it created in tmp dir. All time, when i fetch some file, it create one tempfile (dragonfly_2010....). No one clean up this files after Dragonfly finish.
Is there some config options to do this? Can i say to no save TempObject?

undefined method `assign' for nil:NilClass

When trying to create a new ActiveRecord model object with an attached image as a nested resource I'm getting this error:

NoMethodError (undefined method assign' for nil:NilClass): dragonfly (0.5.3) lib/dragonfly/active_record_extensions//class_methods.rb:22:inimage='
app/controllers/admin/beverages_controller.rb:22:in new' app/controllers/admin/beverages_controller.rb:22:increate'
haml (2.2.3) lib/sass/plugin/rails.rb:19:in process' dragonfly (0.5.3) lib/dragonfly/middleware.rb:13:incall'

In my Beverages model I've got this association set up:

has_one :pro_picture, :as => :imageable
accepts_nested_attributes_for :pro_picture, :allow_destroy => true

and the ProPicture model inherits from a Picture model where I've got this:

belongs_to :imageable, :polymorphic => true
image_accessor :image

I'm btw. using Rails 2.3.5 and Ruby 1.8.6.

gentoo+refinerycms+dragonfly = doesn't show any thumnail.

refinerycms doesn't show any thumnail. Error

Dragonfly::FunctionManager::UnableToHandle: None of the functions registered with #Dragonfly::Processor:0x7f82f8040c90 were able to deal with the method call thumb(#<Dragonfly::TempObject:0x7f82f8136a28 file=#<File:/home/wolf/www/cur/public/system/images/2011/01/13,"135x135#c"). You may need to register one that can.

soft version
refinerycms-0.9.8.9
dragonfly-0.8.2
rails-3.0.3
ruby-17.8.7_p302 or 1.9.2
gentoo

rails 3.0.5 problem

And the stack trace
Can I help with this somehow?

/home/dasdsad/www/.ruby/gems/1.8/gems/actionpack-3.0.5/lib/action_dispatch/middleware/stack.rb:86:in assert_index': No such middleware to insert after: "Rack::Lock" (RuntimeError) from /home/dasdsad/www/.ruby/gems/1.8/gems/actionpack-3.0.5/lib/action_dispatch/middleware/stack.rb:57:ininsert_after'
from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/configuration.rb:37:in send' from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/configuration.rb:37:inmerge_into'
from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/configuration.rb:36:in each' from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/configuration.rb:36:inmerge_into'
from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:161:in build_middleware_stack' from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application/finisher.rb:35 from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:ininstance_exec'
from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in run' from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:50:inrun_initializers'
from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in each' from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:inrun_initializers'
from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:134:in initialize!' from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:insend'
from /home/dasdsad/www/.ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in method_missing' from /home/dasdsad/www/lang-app-dev/config/environment.rb:4 from /home/dasdsad/www/.ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:inrequire'
from /home/dasdsad/www/.ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in require' from /home/dasdsad/www/.ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:inload_dependency'
from /home/dasdsad/www/.ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in new_constants_in' from /home/dasdsad/www/.ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:inload_dependency'
from /home/dasdsad/www/.ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in require' from /home/dasdsad/www/lang-app-dev/config.ru:2 from /home/dasdsad/www/.ruby/gems/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:ininstance_eval'
from /home/dasdsad/www/.ruby/gems/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in initialize' from /home/dasdsad/www/lang-app-dev/config.ru:1:innew'
from /home/dasdsad/www/lang-app-dev/config.ru:1

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.