I want my users to crop all of the images they upload, but I want to make sure their images maintain the proper aspect ratio. How can I do this?

This is possible using the v3 library and the onFileSelected callback. Below please find some example code showing how this can work.

Change crop ratio before Upload

Change crop ratio before Upload
var height = document.getElementById("input-height"); console.log(height.value); var width = document.getElementById("input-width"); console.log(width.value); client.pick({ accept: 'image/*', transformations: { crop: { aspectRatio: height.value / width.value } }, storeTo: { location: 's3', }, }).then(function(result) { console.log(JSON.stringify(result.filesUploaded)) })