Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

Can't display a img using base64

$
0
0

@slammers wrote:

Hello Guys, im stuck with a Problem. In my App i want to load all Images in a Folder and displays these. I finished this part of the App already. Now I want to Display the image in a new page and show the exif Metadata of the Image. For getting the EXIF Data I need to display the Image by her Base64 Data. Here I get an error.
I converted the File to Base64 with the Base64 Plugin

this.base64.encodeFile(this.pictureItem.nativeURL).then((base64File: string) => {
  this.data = base64File;
  var tmp = data.substring(data.indexOf(','));
  this.data = 'data:image/jpeg;base64' + tmp;
}, (err) => {
  console.log(err);
});

A Base64 String is generated successful.
If I pass this String into a HTML img, nothing happens.

<img [src]="data"/>

I tried a sanitizer.bypassSecurityTrustResourceUrl already, but if I use the pipe im getting just “error” in Android Studio Console.

Please help.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>