I've inherited a site that uses a less then ideal way to handle images, they have been stored in the DB as BLOBs. The image tags consist of
<img src='image.php?id=22' />
but no images are displaying. When I visit the image.php?id=22 page, the BLOB data is just dumped out on to the screen (all funny characters) and no image is shown. I'm not sure if this has to do with the content type of data that's being sent to the browser? I've been told "this used to work fine until a few weeks ago".
My question is, is it even possible to display BLOB data as the src attribute of an image tag?
EDIT: by request, here are the contents of image.php. Hope this is of some use.
<?
error_reporting(0);
include("../inc/connect.inc");
include("../inc/common.inc");
include("item.class");
$item = new Item($id);
echo $item->Picture;
?>
EDIT2: If i add the content-type line, the page just prints out the path to the image: http://www.site.com/dir/image.php?id=49. Tried with several content types, no difference. Strange!