|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-05-22 01:24 UTC] ahmedt at student dot cbhs dot school dot nz
Description: ------------ I can't create images width images functions. Even the pp documentation examples for png image returns something like "The [URL] contains error, image can't be displayed". If yiu take off the 'header()' call. It returns some squares, un-readable by human characters. I am using GD 2.0.34.(php 5.2.5) phpinfo() says GD is enabled and able to make png, jpeg, gif images. GD version is the version that comes with PHP 5.2.5 Reproduce code: --------------- something like "The url http://127.0.p0./image.php contains error, image can't be displayed". Actual result: -------------- To output images png,jpeg ect. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 17:00:01 2025 UTC |
Sample Code: taken out pf PHP Doumentation. It's an example by php documentation to illustrate the use of imagecreate(). <?php header("Content-type: image/png"); $im = @imagecreate(110, 20) or die("Cannot Initialize new GD image stream"); $background_color = imagecolorallocate($im, 0, 0, 0); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, "A Simple Text String", $text_color); imagepng($im); imagedestroy($im); ?>