UIImagePickerControllerMediaEvent: editedImage property
The editedImage property is the photo after the user cropped it.
Value
A UIImage or null. It is null when allowsEditing is off.
- Read-only. Assigning to it throws
TypeError. - When the event is created with
newwithout it, it isnull.
Examples
js
const picker = new UIImagePickerController();
picker.allowsEditing = true;
picker.addEventListener('pick', (e) => {
const photo = e.editedImage ?? e.originalImage;
console.log(photo.size.width);
picker.dismissViewController({ animated: true });
});Effect: after taking and cropping a photo, prints the cropped photo's width. Not verified.
Corresponding iOS API
info[UIImagePickerControllerEditedImage].