Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Asset#dimensions can break #13

Open
kintner opened this issue Nov 3, 2009 · 0 comments
Open

Asset#dimensions can break #13

kintner opened this issue Nov 3, 2009 · 0 comments

Comments

@kintner
Copy link

kintner commented Nov 3, 2009

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]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant