0

I'm facing an issue since iOS 14 was released, where the images returned from UIImagePickerController are much larger than they used to be, and compressing them in Swift using jpegData(compressionQuality: 0.0) still produces an image that is too large for my needs. Does anyone know how I can further compress it, or adjust UIImagePickerController to give me back a lower quality image?

Thanks

SeanT
  • 1,741
  • 1
  • 16
  • 24
  • 1
    Can you use HEIC instead of JPEG? – Leo Dabus Nov 27 '20 at 23:48
  • Otherwise just scale your image before compressing it. Your issue is probably images with a higher resolution because of the new devices. – Leo Dabus Nov 27 '20 at 23:55
  • Can you show the code you are using to test this peculiar claim? I find it very hard to believe that one and the same image is "much larger" on iOS 14 than on iOS 13. You need to back that up with some kind of proof. – matt Nov 28 '20 at 00:09
  • Also, usually the way to make an image smaller is not to worry about its _compression_ but to _scale it down_. You will never need an image with the dimensions that the picker gives you; that's far larger than the device screen. Your first move should be reduce the image's dimensions. The ImageIO framework will do that for you; in fact, if you use the Image URL that the picker gives you, you can load the smaller image without ever having to hold the larger image in memory. – matt Nov 28 '20 at 00:11

0 Answers0