How to get the compressed file size of an image received from `UIImagePickerController`?

后端 未结 4 1444
再見小時候
再見小時候 2021-01-14 11:58

I want to know the size of image taken by UIImagePickerController by camara or library. Is there any way to find that ?

Requirement is like,

If

4条回答
  •  野的像风
    2021-01-14 12:12

    If you have a path you could ask file manager:

    attributesOfItemAtPath:error:
    

    The key 'NSFileSize' is what you're looking for in the dictionary.

提交回复
热议问题