Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.