|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-06-21 08:53 UTC] 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ӹ?PLTE?ěȀ?IDATx?큁? ?@?!ҦIEND?B`?"
(Without ")
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 16:00:01 2025 UTC |
the reproduce code... supposed to be the same test file... so Open "test1.php"... and include("test1.php"); :)