#45063 [Fbk->Csd]: Image functions doesn'twork

From: Date: Sun, 25 May 2008 02:20:47 +0000
Subject: #45063 [Fbk->Csd]: Image functions doesn'twork
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-125229@lists.php.net to get a copy of this message
ID: 45063 User updated by: ahmedt at student dot cbhs dot school dot nz Reported By: ahmedt at student dot cbhs dot school dot nz -Status: Feedback +Status: Closed Bug Type: GD related Operating System: Windows XP Home PHP Version: 5.2.5 Assigned To: pajoye New Comment: It didn't work by removing the end "?>". Problem was due to script encoding. I was using 'Notepad++' which has been set 'utf-8'. When I changed the encoding to 'ANSI' everything worked EVEN with the end "?>" Previous Comments: ------------------------------------------------------------------------ [2008-05-23 00:47:11] pajoye@php.net remove the "?>" and everything will run fine. You are sending chars (like new lines and white spaces). ------------------------------------------------------------------------ [2008-05-22 23:31:06] ahmedt at student dot cbhs dot school dot nz 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); ?> ------------------------------------------------------------------------ [2008-05-22 08:19:27] pajoye@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2008-05-22 01:24:35] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45063&edit=1

« previous php.bugs (#125229) next »