phonegap-base64 icon indicating copy to clipboard operation
phonegap-base64 copied to clipboard

Image converted but wrong

Open marcogrieco opened this issue 7 years ago • 3 comments

Hello, i'm using this plugin but i have a problem. The plugin returns a BASE64 string for an image but if i try to show this image in an img html tag nothing is showed. I have tried also with online tools to show base64 images and i receive this error: "corrupted image".

What i'm wrong?

Thanks.

marcogrieco avatar Oct 27 '17 08:10 marcogrieco

The plugin doesn't work only on Android. For iOS the base64 is correctly a string of an image. On Android i receive a string but is not an image.

Any suggestion?

marcogrieco avatar Nov 03 '17 14:11 marcogrieco

let variavel = this.sanitizer.bypassSecurityTrustResourceUrl(base64File) Retorna URL valida para colocar na view

allys00 avatar Jan 02 '18 17:01 allys00

Remove \n from base64 data after that it will work

base64.replace(/\n/g, '')

Nayan014 avatar Aug 14 '20 06:08 Nayan014