Reply to Re: imagecreatefrompng displays raw data

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация