Does prefix 'data:image/png;base64,' of base64 affect to displaying image?

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. :)

Answers


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


Need Your Help

Pandas and unicode

python unicode pandas

This is a string I'm getting out of pandas.DataFrame.to_json(), putting it into redis, getting it out of redis elsewhere, and trying to read it via pandas.read_json():