|
Posted by Andy Hassall on 10/01/22 11:28
On 5 Oct 2005 03:40:31 -0700, subramanian.venkateswaran@gmail.com wrote:
><?php
>header('Content-type: image/png');
>$source = imagecreatefrompng('C:\Swing_Bridge.png');
Careful with your slashes here - whilst this is fine, you're generally better
off using unix-style "/" slashes, since Windows will accept this, and it
doesn't risk confusion with escape sequences.
>$thumb = imagecreatetruecolor(100, 75);
>header('Content-type: image/png');
You already sent the content-type in the first line.
>imagecopyresized($thumb, $source, 0, 0, 0, 0, 100, 75, 800, 600);
>imagepng($thumb);
>?>
>
>Output
>========
>PNG
There's nothing obviously wrong as the two potential issues shouldn't actually
matter; the script works on my setup (after changing the filename).
What content-type is actually getting through to the client? Use something
like the Live HTTP Headers extension for Firefox, or wget, or even telnet to
the webserver and issue an HTTP GET command directly to see.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
[Back to original message]
|