#45371 [Com]: SWFBitmap object can not be returned
| From: | letmegetone at hotmail dot com | Date: | Fri, 27 Jun 2008 05:08:15 +0000 |
| Subject: | #45371 [Com]: SWFBitmap object can not be returned | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-126053@lists.php.net to get a copy of this message | ||
ID: 45371
Comment by: letmegetone at hotmail dot com
Reported By: letmegetone at hotmail dot com
Status: Open
Bug Type: Ming related
Operating System: Windows XP SP3
PHP Version: 4.4.8
New Comment:
I posted the completed CODES on a Chinese-based website:
http://club.phpe.net/index.php?act=ST&f=15&t=13441&s=
Previous Comments:
------------------------------------------------------------------------
[2008-06-27 05:02:59] letmegetone at hotmail dot com
Description:
------------
I want to put some worked codes into a function, in order to make my
main script shorter.
All other MING classes work well,such as SWFSprite,SWFShape, except
SWFBitmap.
I can get the error message from apache2:
PHP Fatal error: output() [<a
href='function.output'>function.output</a>]: Initial Jpeg marker not
found!
It seems that the SWFBitmap object can not be returned in a function.
I tried test like this:
CODE I + CODE III :FAILED
CODE II + CODE IV :WORKS
CODE I + CODE II + CODE III : WORKS
Reproduce code:
---------------
function get_b()//CODE I
{
$mfile="xx.jpg"; $fp=fopen($mfile,"r");
$string=fread($fp,filesize($mfile));
$b = new SWFBitmap($string);
fclose($fp);
return $b;
}
$mfile="xx.jpg"; $fp=fopen($mfile,"r");//CODE II
$string=fread($fp,filesize($mfile));
$b = new SWFBitmap($string);
fclose($fp);
$s = new SWFShape();
$scale= $s->addFill(get_b()); //CODE III
$scale= $s->addFill($b); //CODE IV
Expected result:
----------------
Can I put the code with the SWFBitmap object into a function?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45371&edit=1