From: jsgoupil at lookstrike dot com
Operating system: WinXP
PHP version: 5.0.0RC3
PHP Bug Type: GD related
Bug description: Weird Bug with imagepng (including special chars)
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?큁?
[EMAIL PROTECTED]?!ҦIEND?B`?"
(Without ")
--
Edit bug report at http://bugs.php.net/?id=28863&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28863&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28863&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28863&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28863&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28863&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28863&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28863&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28863&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28863&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28863&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28863&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28863&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28863&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28863&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28863&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28863&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28863&r=float