Jump to content

Very odd GD2 problem


Adamn

Recommended Posts

I just upgraded to windows XP from Vista (fresh reformat) and I'm having a very strange problem with getting the gd2 library to work.

 

http://localhost/phpinfo.php

 

yields

 

PHP Version 4.3.10

..

..

gd

GD Support enabled

GD Version bundled (2.0.28 compatible)

FreeType Support enabled

FreeType Linkage with freetype

GIF Read Support enabled

GIF Create Support enabled

JPG Support enabled

PNG Support enabled

WBMP Support enabled

XBM Support enabled

..

 

 

This would be all well and good, except a very simple test script will produce an error:

 

The image “http://localhost/square.png” cannot be displayed, because it contains errors.

 

square.png:

<?php

$im = imagecreatetruecolor(100, 100);

// sets background to red
$red = imagecolorallocate($im, 255, 0, 0);
imagefill($im, 0, 0, $red);

header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?> 

 

For the life of me, this is the simplest thing I could do with the gd library, and it won't work.  I'm stumped.

Link to comment
https://forums.phpfreaks.com/topic/50978-very-odd-gd2-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.