The current way I’m doing this is like this:
def avatar_geometry
width = 0
height = 0
self.avatar.manipulate! do |img|
# this is kind of a hack, we're actually not manipulating anything here, we just
# need access to imagemagick
@width = img[:width]
@height = img[:height]
img
end
{:height => @height, :width => @width}
end
We all know that manipulate is not used for this kind of purpose, I have tried hours trying to open the file through MiniMagick directly but it’s stored in GridFS and I could not find a way to open it directly, is there a better way to do this?
What about this metadata plug-in?
https://github.com/gzigzigzeo/carrierwave-meta