UIImageJPEGRepresentation and UIImagePNGRepresentation returns nil in iOS 13
问题 In my app I'm using the image picker to select an image on an iPhone. After the image was selected, I do: data = UIImageJPEGRepresentation(image, 1.0); On iOS 12.4.1 and below, everything works fine, if I pick either PNG or JPEG image. On iOS 13, JPG works fine, but PNG does not. If I pick a JPG: data = UIImageJPEGRepresentation(image, 1.0); // works data = UIImagePNGRepresentation(image); // works But if I pick a PNG: data = UIImageJPEGRepresentation(image, 1.0); // data is nil data =