Using UIImagePickerController to get image — how to know whether to save PNG or JPEG?

后端 未结 2 828
既然无缘
既然无缘 2021-01-13 00:36

I\'ve got a UIImagePickerController letting the user pick an image out of the image library, and am getting its results via the didFinishPickingMediaWithI

2条回答
  •  情话喂你
    2021-01-13 01:03

    in the dictionary the key UIImagePickerControllerReferenceURL will give you informations about the type

    (gdb) po info

    {
        UIImagePickerControllerMediaType = "public.image";
        UIImagePickerControllerOriginalImage = "";
        UIImagePickerControllerReferenceURL = "assets-library://asset/asset.JPG?id=EFC44C3C-9C82-4669-924B-A2B9DE6F1F45&ext=JPG";
    }
    

    In this case it is a jpg as shown by ext=JPG

提交回复
热议问题