Merge branch 'image_sizing' of https://github.com/themgt/engine into themgt-image_sizing

This commit is contained in:
did 2011-03-17 17:54:59 +01:00
commit 630577658d

View File

@ -54,7 +54,8 @@ class AssetUploader < CarrierWave::Uploader::Base
def set_width_and_height
if model.image?
model.width, model.height = `identify -format "%wx%h" #{file.path}`.split(/x/).collect(&:to_i)
magick = ::Magick::Image.read(current_path).first
model.width, model.height = magick.columns, magick.rows
end
end