1
votes

I am using AngularJS. I display my image as: src="data:image/png;base64,iVBORw0KG..." successfully. When I change 'png' to jpeg, gif or jpg, nothing happened. It still displays correctly. So I want to ask you the prefix affect to displaying image or not? Negative or positive?

Moreover, I receive data image from server without any prefix. So I have to set a hardcode 'data:image/png;base64,'. This is good or bad? Could you pls help me? Thanks so much. :)

1

1 Answers

0
votes

In html case, when you set scr=base64String, if the image doesnt have the prefix, it will not be displayed correctly.