|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-12-08 02:37 UTC] sixd@php.net
[2012-12-08 02:37 UTC] sixd@php.net
-Summary: 5.16.1
+Summary: imagefttext or imagettftext both function are return
a blank image
-Status: Open
+Status: Not a bug
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 09 06:00:01 2025 UTC |
Description: ------------ Note: I i've choose wrong version on PHP Version list because my php version not available on list option... I am using xampp on localhost/computer with Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 imagefttext or imagettftext both function are return a blank image (null) and my gd library was also enable ...tell me what should i do... Test script: --------------- // Set the content-type header('Content-Type: image/png'); // Create the image $im = imagecreatetruecolor(400, 30); // Create some colors $white = imagecolorallocate($im, 255, 255, 255); $grey = imagecolorallocate($im, 128, 128, 128); $black = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 399, 29, $white); // The text to draw $text = 'Testing...'; // Replace path by your own font path $font = 'arial.ttf'; // Add some shadow to the text imagefttext($im, 20, 0, 11, 21, $grey, $font, $text); // Add the text imagefttext($im, 20, 0, 10, 20, $black, $font, $text); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im); imagedestroy($im);