paperclipped
paperclipped copied to clipboard
Asset#dimensions can break
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]