note 60732 deleted from ref.image by tularis
| From: | tularis@php.net | Date: | Sun, 29 Jun 2008 21:03:06 +0000 |
| Subject: | note 60732 deleted from ref.image by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140928@lists.php.net to get a copy of this message | ||
Note Submitter: jan at anh dot sk
----
When outputing an image from a script to a browser, use header("Content-Length: XYZ")
together with Content-Type header. This avoids problems rendering-displaying the image with some
browsers (f.i. MSIE) - fixes random image cutting of image bottom parts. Image from cache example:
<?php
$cache_file = "imagecache/{$ID}.img";
header("Content-Type: image/jpeg");
header("Content-Length: ".filesize($cache_file));
$cache = fopen($cache_file,"r");
fpassthru($cache);
fclose($cache);
exit;
?>
Problem observed @ Linux, Apache 2.0, PHP 4.3.10