Want to check image dimensions in pre-batch validation
hello ,
I wan to use pre-batch validation before uploading file, is it possible to get selected file in prebatch so I can check dimensions of images ?
-
Hi,
The preBatch method of the Upload Widget is called before the files are sent to the widget for processing, and the dimensions are not known at that time, and not available to that method.
If you need to limit the dimensions of uploaded files, there are other options of the upload widget that will enforce minimum or maximum dimensions, or can be used to resize the asset before uploading: https://cloudinary.com/documentation/upload_widget_reference#client_side_parameters
If you need to store the dimensions after upload, the details are included in the API call response that's sent to your code in the "success" event by the widget: https://cloudinary.com/documentation/upload_widget_reference#success
You can also reduce the dimensions of uploaded assets after they're uploaded and before they're saved using an incoming transformation in the upload preset that you use with the widget: https://cloudinary.com/documentation/transformations_on_upload#incoming_transformations
Please let us know if you have additional questions either by replying here, or by opening a support request for our team.
Regards,
Stephen
0
Post is closed for comments.
Comments
1 comment