When setting the
cropping parameter to
true in the Upload Widget's options, the custom cropping coordinates are passed to Cloudinary as part of the image's metadata, and the full-sized image is uploaded by default.
Once the image has been uploaded, those coordinates that were selected by the user can be used when using our different cropping or resizing methods. For example, you can request an image cropped to the exact coordinates selected in the widget by using a crop mode of 'crop' and 'gravity' of 'custom'. For example:
If you don't want to store the original full-sized image, just the selected crop, you can apply an "incoming transformation" and the image will be cropped before being stored in your account. This can be done by adding the same 'c_crop,g_custom' option to the Upload Preset used by the widget:
- Go to the Upload settings page.
- Click on the "Edit" link next to the upload preset you use for the widget.
- Look for "Incoming Transformation" and click on the "Edit" link next to it.
- Under "Resize & crop" set the "Mode" to "Crop" and the "Gravity" to "Custom".
- Click on "OK" and Save the changes.
Now, when the widget uploads a file, we'll crop it to the selected coordinates and save the result to your account.