I got this bit of info this morning from my Apache error log:
libpng warning: Application
built with libpng[masked] but running with 1.5.5
gd-png error: cannot
allocate libpng main struct
Does this mean I need to use an older version of libpng for compilation?
I don't know if this has anything to do with my problem but the output for this script:
function test ($string, $test)
echo $string . '... ';
$token = "Testing GD!";
// Create image
$pic = ImageCreate (300, 300);
test ('Creating image', $pic);
$col2 = ImageColorAllocate ($pic, 0, 0, 100);
$col1 = ImageColorAllocate ($pic, 200, 200, 200);
// Test PNG/JPG functionality
$res1 = @ImagePNG ($pic);
$res2 = @ImageJPEG ($pic);
test ('Testing PNG output', $res1);
test ('Testing JPEG output', $res2);
// Test TrueType functionality
$ttfont = trim (`locate -n 1 .ttf`);
test ('Testing FreeType', @ImageTTFText
($pic, 30, 0, 10, 40, $col1, $ttfont, $token));
test ('Testing FreeType2', @ImageFTText
($pic, 30, 0, 10, 40, $col1, $ttfont, $token, array()));
// Test Type1 functionality
$font = @ImagePsLoadFont (trim (`locate -n 1 .pfb`));
$res = @ImagePsText ($pic, $token, $font, 10, $col1, $col2, 0, 0);
test ('Testing the Type1 library', ($font && $res));
test ('Destroying image', ImageDestroy($pic));
shows some errors:
Testing PNG output...
Testing JPEG output...
Both libraries (libpng and freetype) are compiled into PHP and are listed as enabled in phpinfo().
Subject: Re: [baltimorephp] Errors using imagecreate
From: Kevin Sours
Date: April 23,[masked]:27 PM
Reply to sender Reply to Meetup
That's actually to be expected. A blank file isn't a valid png. Next step is to check your error reporting in the php.ini. You almost certainly have an error in your script that isn't displaying.
display_errors = 1 is the easy way, but I'd recommend configuring php error logging if it isn't (and checking the error log if it is). I think default is to log to the apache error log file, but who knows what your install wants to do.Kevin