how can I to convert a photo taken from my camera to binary using swift?
now I transform image to UIImage and after I try to do it using pngData() or jpegData(compressionQuality: 1.0)
It's works well with a png image or jpeg image stoked in my gallery but if I try with a camera photo it doesn't work, the result is a black image
let uiImage: UIImage = image.asUIImage() let imageData: Data = uiImage.jpegData(compressionQuality: 1.0) ?? Data() //uiImage.pngData() ?? Data()