Re: dynamic <img>

From: Date: Tue, 18 Sep 2007 15:40:37 +0000
Subject: Re: dynamic <img>
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-262204@lists.php.net to get a copy of this message
Anugrah Widya wrote:
dear friends :), i have problem with dynamic image displaying here the snippets thumb.php <?php header("Content-type: image/jpg"); $file = "data/original/filename.jpg"; readfile($file); ?> img.php <img src="thumb.php?filename.jpg" /> problem is i always get broken images, someone know how to fix this ?
Rather than viewing img.php, go directly to thumb.php?filename.jpg in your browser. Change the content-type to text/plain and see what you get in the browser. You may also want to remove the ?> at the end of thumb.php - it's not needed and may be adding whitespace to the image you are returning. -Stut -- http://stut.net/

« previous php.general (#262204) next »