I have a share extension that lets you crop an image and then upload it to our service. We call UIImageJPEGRepresentation
to get the image's data before we upload it, but causes a crash due to memory excessive memory. This only happens with large images, and (as far as we can tell) on the SE, and didReceiveMemoryWarning
is not called first. This is happening when using the Photos app.
Is there anyway to safely call UIImageJPEGRepresentation
, or try to determine if the image is too large beforehand?