Merge branch 'image_sizing' of https://github.com/themgt/engine into themgt-image_sizing
This commit is contained in:
commit
630577658d
@ -54,7 +54,8 @@ class AssetUploader < CarrierWave::Uploader::Base
|
|||||||
|
|
||||||
def set_width_and_height
|
def set_width_and_height
|
||||||
if model.image?
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user