Does anyone know how to convert a UIImage
to a Base64 string, and then reverse it?
I have the below code; the original image before encoding is good, bu
//convert Image to Base64 (Encoding)
let strBase64 = imageData.base64EncodedString(options: .lineLength64Characters)
print(strBase64)
// convert Base64 to Image (Decoding)
let dataDecoded:NSData = NSData(base64EncodedString: strBase64, options: NSDataBase64DecodingOptions(rawValue: 0))!
let decodedimage:UIImage = UIImage(data: dataDecoded)!
print(decodedimage)
yourImageView.image = decodedimage