I’m try to get the size in bytes of UIImage. The problem is that my actual image is of 5MB and when i get the size using
let image = info[UIImagePickerController.InfoKey.originalImage] as! UIImage
let imgData = NSData(data: image.jpegData(compressionQuality: 1)!)
var imageSize: Int = imgData.count
print("actual size of image in KB: %f ", Double(imageSize) / 1000.0)
I’m getting 2MB only. can anyone enlighten me on this please.