How to set max image height?
I am working on an app where users can upload images. I have set a max width of 400 and using the 'fill' value for crop like so:
:src="
config.public.cloudinaryBaseURL +
config.public.cloudinaryCloudName +
`/c_fill,f_auto,q_auto:good,w_400/${post.public_id}`
"
But how to handle issues of really tall images? Can I set a max height while keeping the width at 400?
Or, should I not be using c_fill for this?
Here is example screenshot where I don't want to go any taller than this:
0
-
Hi Nick,
Thanks for reaching out. I would advise the c_lfill transformation. This will scale the image down to the maximum dimension(s) that you specify, only if the original image is larger than what you've specified. I can link to our documentation on that cropping mode for your reference: https://cloudinary.com/documentation/transformation_reference#c_lfill
Can you take a look at those docs and let me know how this works for your use case?Kind Regards,
Tia
0
Post is closed for comments.
Comments
1 comment