Imagecreatefrompng problem
<p>I took code from the <a href="http://php.net/manual/en/function.imagecreatefrompng.php" rel="nofollow">php.net</a></p>

<pre><code>function LoadPNG($imgname)
{
    $im = @imagecreatefrompng($imgname);

    if(!$im)
    {
        $im  = imagecreatetruecolor(150, 30);
        $bgc = imagecolorallocate($im, 255, 255, 255);
        $tc  = imagecolorallocate($im, 0, 0, 0);

        imagefilledrectangle($im, 0, 0, 150, 30, $bgc);

        imagestring($im, 1, 5, 5, 'Error loading ' . $imgname, $tc);
    }

    return $im;
}

header('Content-Type: image/png');

$path = './upload/xxx.png';
$img = LoadPNG($path);

imagepng($img);
imagedestroy($img);
</code></pre>

<p>and I have message in browser and page doesn't load:</p>

<p>No data received
Unable to load the webpage because the server sent no data.
Here are some suggestions:
Reload this webpage later.
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.</p>

<p>But if I change imagecreatefrompng to imagecreatefromjpeg, imagepng to imagejpeg and path to jpeg file. Or write incorect file I have error image (imagestring) - it works fine...</p>
