I want to output an inline jpg image as a base64 encoded string, however when I do this :
$contents = file_get_contents($filename);
print "<img src=\"data:image/jpg;base64,".$contents."\"/>";
Where $filename
is a local text file with the base64 image. The output is as follows :
<img src="data:image/jpg;base64,/9j/4A..... (the rest of the file)...." />
And obiously the image is not rendered, but where does 
come from ? It is not in the text file. If removed, the image is displayed properly.