0

I am storing images in an SQLite database as base64Strings and using the following to decode the images again:

let dataDecoded = Data(base64Encoded: imageString, options: .ignoreUnknownCharacters)
let decodedImage:UIImage = UIImage(data: dataDecoded!)!

imageView.image = decodedImage

For some images, this works, but others are shown flipped vertically. Can anyone see a reason why it only works for some?

TIA

EDIT: How the image was encoded:

let imageEncoding = userImage.pngData()!.base64EncodedString(options: .lineLength64Characters)

For images, I just used the default ones in the simulator

Ben Dent
  • 41
  • 7

0 Answers0