#28863 [Opn->Bgs]: Weird Bug with imagepng (including special chars)

From: Date: Wed, 23 Jun 2004 20:29:29 +0000
Subject: #28863 [Opn->Bgs]: Weird Bug with imagepng (including special chars)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-61259@lists.php.net to get a copy of this message
ID: 28863 Updated by: moriyoshi@php.net Reported By: jsgoupil at lookstrike dot com -Status: Open +Status: Bogus Bug Type: GD related Operating System: WinXP PHP Version: 5.0.0RC3 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php imagettftext() expects UTF-8 for the encoding in which the text is stored. See: http://www.voltex.jp/articles/imagettf_m10n/ Previous Comments: ------------------------------------------------------------------------ [2004-06-21 08:56:06] jsgoupil at lookstrike dot com the reproduce code... supposed to be the same test file... so Open "test1.php"... and include("test1.php"); :) ------------------------------------------------------------------------ [2004-06-21 08:53:01] jsgoupil at lookstrike dot com Description: ------------ You will say that i'm really weird to do that, but i don't know how that happen : I check into one file, i found the following chars : chr(239) + chr(187) + chr(191) Keep the order ! it's important ! (I found that in one of my file, but dont ask me why !) If you try to include this kind of file before doing a PNG image, you will get a WRONG png format. (Starting with "?PNG"...) The chars above can't be read under Notepad, neither under IE (perhaps because i'm under WinXP). It can't be deleted from NotePad (if you clear the file completly, the file will still have 3bytes undeletable) but you can delete it with wordpad... I search really a lot of time to found that problem... because I was including a file that had that kind of chars... Reproduce code: --------------- VBScript to put chr into file Open "test1.php" For Output As #1 Print #1, Chr(239) + Chr(187) + Chr(191) Close #1 PHP Script : <?php include("test3.php"); $im = imagecreate(1024, 1024) or die("Can't Initialize the GD Libraty"); imagecolorallocate($im,255,255,255); imagepng($im); ?> Expected result: ---------------- Supposed return some chars in IE and after the PNG format like : "‰PNG "..... Because normally, if you do a echo "a"; imagepng($im); You will receive the "a" and after the PNG format in text. Actual result: -------------- Under WinXP I receive directly the wrong PNG format... like : "?PNG  IHDRE&#1273;?PLTE?&#283;&#512;?IDATx?&#53313;? ?@&#61828;?!&#1190;IEND?B`?" (Without ") ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28863&edit=1

« previous php.bugs (#61259) next »