I'm trying to use this code in my uploader
version :thumb do
process :scale => [50, 50]
end
and I get an error saying
undefined method `scale' for #<#<Class:0x235b680>:0x0fb4c8>
I'm using Carrierwave with MiniMagick. How can I fix this error?
Instead of calling scale call resize_to_fit
process :resize_to_fit => [50, 50]
or resize_to_fill if you dont want to keep aspect ratio
EDIT
My bad, both resize_to_fit and resize_to_fill are keeping the aspect ratio.
The difference is that resize_to_fit will keep whole image in given bounds, and resize_to_fill will fill whole given area so it can cut your image when necessary.
The scale
method is an example (generated by carrierwave in uploader) you need to use RMagic
(or minimagick
) functions (in their own gem, since smaller version of them is included in carrierwave) if you want to scale and therefor, not preserve the original image's ratio
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With