kbingman / paperclipped

Please note, this extension is no longer being developed. Please take a look at the radiant-clipped-extension instead. Radiant extension for managing assets and images with the Paperclip plugin.
Other
122 stars 64 forks source link

Asset#dimensions can break #13

Open kintner opened 15 years ago

kintner commented 15 years ago

If you have an asset_updated_at column on your asset table this causes paperclip to append a timestamp on the url it generates. This breaks Asset#dimensions since it uses the thumbnail method to generate the path to the file. Instead you could use something like this

file = new_record? ? asset.instance_variable_get("@queued_for_write")[:original] : asset.path(size.to_sym)
geometry = Paperclip::Geometry.from_file(file)
[geometry.width.to_i, geometry.height.to_i]