Re: Image Headers break when image is out of bounds

From: Date: Tue, 11 Aug 2009 18:08:13 +0000
Subject: Re: Image Headers break when image is out of bounds
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-296647@lists.php.net to get a copy of this message
On Tue, 2009-08-11 at 19:02 +0100, Ashley Sheridan wrote: > I've got a bit of a weird one here. I'm using PHP to output an image. > This works fine when I output as a file, but when I try to feed it > directly to the browser it fills the screen with random characters. > > I know I've got the headers right, as it works some of the time. The > only thing I can spot when it does fail is that some of the image > drawing commands are essentially drawing off the edge of the image area. > I've checked the error logs, and the only errors/notices I can find > today are a bug in phpMyAdmin and a missing favicon file, nothing to do > with this script. > > Has anybody ever noticed a similar problem? > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > Oh. I should note that there has been no headers sent already, as I put the image output part inside of a if(!headers_sent()) block. The headers I'm using for the PNG image are: header("Content-Type: image/png"); header("Pragma: no-cache"); header("Expires: 0"); Thanks, Ash http://www.ashleysheridan.co.uk

« previous php.general (#296647) next »