RE: [PHP-WIN] SWFBitmap jpg to swf?
| From: | Martin Lindhe | Date: | Fri, 08 Feb 2002 09:23:55 +0000 |
| Subject: | RE: [PHP-WIN] SWFBitmap jpg to swf? | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-11909@lists.php.net to get a copy of this message | ||
> Why does this:
> $img="image.jpg";
> 10 $fp = fopen($img,"rb");
> 11 $i = fread($fp,filesize($img));
> 12 $s = new SWFBitmap($i);
>
> Produce this:
>
> Fatal error: Sorry, can't tell what type of file ÿØÿà is in
> C:\Inetpub\wwwroot\dawndusk\serlient\test.php on line 12
>
> When I print $i; I get the correct binary jpg text.
>
> I am taking the code from php.net and it did work before I
> switched to 4.1.1
Read the documentation for SWFBitmap(), it says it takes a filename for a
jpeg as a parameter.
So try
$img="image.jpg";
$s = new SWFBitmap($img);
/Martin