Anyone had any experience with this?
Thanks for trying to help me out (again!!).
Its on my local server, so download shouldnt be a problem. But it does seem to be a problem related to not getting the whole image loaded, since if I reduce the colour depth in Paintshop I can get a larger area displayed. However, reducing to 2 colours still only got about half the image. My other image is a brown square, that displays properly. I wondered if my server might be set up funny, I couldnt see anything out of place, but it was a bit like looking for a needle in a haystack.
Cheers
The image works fine in the browser. Its when I try and use the script to output it. If it has more than one colour it gets really screwed up. File size is a whopping 2k, cant see what the problem is!!
Im sure it shouldnt matter that the script is triggered using img src="blahblah.pl" and then outputting using a gif mime type. But is it possible this is the problem?
open (IMAGE, "c:\\apache\\htdocs\\images\\square.gif");
$size = -s "c:\\apache\\htdocs\\images\\square.gif";
read IMAGE, $data, $size;
close IMAGE;
print "Content-type: image/gif\n\n";
print "$data";
Cheers
I am doing a very very similiar construct as the perl one, and yet I get garbage on my browser screen.
For instance, i have a
<img src="view.php">
and view.php reads the database with your standard ol' "SELECT"(which has the binary data of an image)
and then outputs it:
$query = "SELECT * FROM background WHERE id = 33";
$result = mysql_query("$query") or die(mysql_Error());
while($row = mysql_fetch_array($result)){
if (!empty($row['image'])){
header("Content-type: image/jpeg");
echo $row['image'];
}
}
?>
I either get alot of garbage, or *nothing*.
Anyone experience there problems? When I upload the file to the server, it do it in "rb" when saving the temp file created... so that should be ok..