Danny
Danny

Reputation: 6025

Can I limit the file size for a attachinary/cloudinary upload

Using attachinary, in combination with cloudinary on Rails - is there a way to limit the size (width & height) of the uploaded image file before uploading it?

Upvotes: 1

Views: 1572

Answers (1)

Tal Lev-Ami
Tal Lev-Ami

Reputation: 1457

You can use an incoming transformation to limit the dimensions of the uploaded image. Larger images will be scaled down, e.g.

<%= form.attachinary_file_field :image, cloudinary: { transformation: { width: 200, height: 200, crop: :limit } } %>

Upvotes: 3

Related Questions