I want to generate Base64 string for a specific image. for that I've wrote below code
let imageData = UIImagePNGRepresentation(imgProfile.image!)!
var imageStr = imageData.base64EncodedString(options: Data.Base64EncodingOptions.lineLength64Characters)
and I'm getting this output string as Base64 which is not decoded (i.e. wrong).
but when I'm generating Base64 from here, I'm getting this output string, which is successfully decoded and getting the image back (i.e. correct)
Please help me to find the issue.
Thanks in advance
I've already visited following threads.
1. https://stackoverflow.com/a/47610733/3110026
2. https://stackoverflow.com/a/46309421/3110026