Sorry for the delayed response. Been busy.
You could in-line the image data into the
<img> src attribute.
For example:
- <!DOCTYPE html>
-
<html>
-
<head>
-
<title>Image Inline test</title>
-
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-
</head>
-
<body>
-
<div>
-
<h3>There should be an image right below this...</h3>
-
<?php
-
$source_image = 'test.png';
-
$raw_data = file_get_contents($source_image);
-
$base64_data = base64_encode($raw_data);
-
?>
-
<img src="data:image/png;base64,<?php echo $base64_data; ?>" alt="Test Image" />
-
</div>
-
</body>
-
</html>
This works in all the real browsers, but - shockingly - it doesn't work IE7 or lower, as well as any current version of Outlook.
(Which is a shame, seeing as how useful this could be in constructing Emails.)
In any case, you are going to want to avoid that in most situations. Loading the images separate from the main page is preferable in most cases. It allows the browser to cache the images separately, and to load the layout of the site before actually loading the images, making it feel "snappier".