|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45371 SWFBitmap object can not be returned
Submitted: 2008-06-27 05:02 UTC Modified: 2008-07-07 00:28 UTC
From: letmegetone at hotmail dot com Assigned:
Status: Closed Package: Ming related
PHP Version: 4.4.8 OS: Windows XP SP3
Private report: No CVE-ID: None
 [2008-06-27 05:02 UTC] letmegetone at hotmail dot com
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

Reproduce code:
function get_b()//CODE I
   $mfile="xx.jpg";   $fp=fopen($mfile,"r");
   $b = new SWFBitmap($string);
   return $b;
   $mfile="xx.jpg";   $fp=fopen($mfile,"r");//CODE II
   $b = new SWFBitmap($string);

   $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?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-27 05:08 UTC] letmegetone at hotmail dot com
I posted the completed CODES on a Chinese-based website:
 [2008-07-07 00:28 UTC] letmegetone at hotmail dot com
The problem is not about SWFBitmap,but the $string.
It can not be changed by fread more than one time.
 [2010-11-24 06:44 UTC] letmegetone at hotmail dot com
I tested it,and found:
   $s = new SWFShape();
   $imgf = $s->addFill($img, SWFFILL_TILED_BITMAP);
it works. But if I try to remove the data of string $img before ouput() called
it failed.
Is that means that all data resources the SWFMovie used should be keept untill output() is done?
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Oct 22 19:01:23 2020 UTC