Pessoal, o código que eu to usando para testar o gd e o freetype é:
<?php
function test ($string, $test)
{
echo $string . '... ';
if ($test)
echo "success.\n";
else
echo "fail.\n";
}
$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
ob_start();
$res1 = @ImagePNG ($pic);
$res2 = @ImageJPEG ($pic);
ob_clean();
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`));
if ($font)
$res = @ImagePsText ($pic, $token, $font, 10, $col1, $col2, 0, 0);
test ('Testing the Type1 library', ($font && $res));
test ('Destroying image', ImageDestroy($pic));
?>
Eu acabo tendo a seguinte resposta do teste:
Creating image... success. Testing PNG output... success. Testing JPEG output... success. Testing FreeType... fail. Testing FreeType2... fail.
Na compilação eu consegui acertar, to configurando o php pra achar as coisas do freetype no /usr/include/freetype2/freetype(--with-freetype-dir=/usr/include/freetype2/freetype
O phpinfo diz:
GD Support enabled
GD Version bundled (2.0.22 compatible)
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
O que eu faço agora? Corto os pulsos? hehe
Preciso de ajuda urgente!