I'm trying to upload 256 x 256 images from my iOS app. I've resized an image to CGSize(width: 256, height: 256)
, but it gets uploaded as 768 x 768. This makes sense, because on my iPhone X, 1 point is 3 pixels.
This isn't consistent though. On some iPhones, 1 point is 2 pixels.
How do I figure out to use CGSize(width: 128, height: 128)
or CGSize(width: 86, height: 86)
?
UIGraphicsBeginImageContextWithOptions
? Look at the documentation for its parameters.