All uploads should be at least 150x150 pixels. How to validate it with Carrierwave?
Why not to use MiniMagick? Modified DelPiero's answer:
validate :validate_minimum_image_size def validate_minimum_image_size image = MiniMagick::Image.open(picture.path) unless image[:width] > 400 && image[:height] > 400 errors.add :image, "should be 400x400px minimum!" end end
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