UIImagePickerController run out of memory with camera source

前端 未结 2 629
一整个雨季
一整个雨季 2021-02-03 16:39

I got a big performance issue using UIImagePickerController and saving the image on disk. I can\'t figure out what I am doing wrong. Here is my code:



        
2条回答
  •  眼角桃花
    2021-02-03 16:52

    Your problem might be due to you taking the original image.

    The original image from the camera has a resolution of around 1200x1400, which is a lot of memory and will cause the device to crash if you try making a picture out of it (it will run out of memory).

    I would suggest resizing the image to be smaller (the native 320x480).

提交回复
热议问题