Uploading image with aspect ratio
Hi, is it possible to resize the image to the given aspect ratio (4:3) when uploading? So that the photo is uploaded with the correct aspect ratio?
-
Hi Esther,
Thanks for your message.
Yes, you can indeed upload an image and supply any of our image transformations which can be applied onto the image before it is stored in your account. This is what we call incoming transformations. The above section in our documentation provides more details on this topic as well as examples with all of our SDKs and how you can also configure this through an upload preset. To give you a short example, you can set a transformation, such as "angle"=>100 and then any image uploaded with that upload method call transformation parameter or with an upload preset that specifies this incoming transformation would be stored in the account rotated to 100 degrees. Of course, in your case, you would specify, aspect_ratio=>4:3 as well as any additional image transformations.
Please take a look and try this out and let me know how it goes or if you have further questions.
Best regards,
Aleksandar
0 -
My presets include:
aspect_ratio: '4:3',
cropping: 'server',
gravity: 'custom'
but when I upload a square photo 450x450, the photo uploaded is still square. Am I missing something?0 -
Hi Esther,
Removing g_custom will fix the issue. Is there a reason you are using cropping server and gravity custom?
You can see the difference below:
https://res.cloudinary.com/demo/image/upload/ar_4:3,c_crop,g_custom/sample.jpg
https://res.cloudinary.com/demo/image/upload/ar_4:3,c_crop/sample.jpg
Regards,
Aditi
0 -
aspect_ratio: '4:3',
crop: 'crop',
theme: 'minimal'
Still doesn't seem to upload with the correct aspect ratio of 4:3.
I should also mention that I'm using the v1 widget.0 -
Hi Esther,
I tested uploading using upload widget v1 with aspect ratio and crop and it uploaded with the aspect ratio. specified. Can you please open a support ticket here: https://support.cloudinary.com/hc/en-us/requests/new and share the cloud name, preset and the widget code so that I can replicate the issue.
Regards,
Aditi0
Post is closed for comments.
Comments
5 comments