If you develop for Flash Lite 1.1, FlashLite Writer Toolkit is a very good and very simple solution for converting JPG files to SWFS on the fly.
For the last year I have been using Flash Writer Toolkit from bronson beta. I’ve been very pleased with it. It is super easy to use, it only has three small PHP files and has no dependencies on any other libraries. I have however been a bit tight lipped on it though, not because I didn’t want to tell people how cool it was but because it had one serious flaw.
The PHP file is old. If was made in the days of solving the problem in Flash 5. Because of that, you have to make a small modification to let the file even open in Flash Lite (based on the flash 4 player). Beyond that though was the more serious issue that It was built for an older version of PHP. Methods like fopen work differently now and the tool simply didn’t work in the newer versions of PHP.
My skills at PHP are very much in the dabbling area and debugging an application that is reconstructing a binary file was really not going to be an afternoon project for me. Laziness won out and I just installed an old version of PHP. Finally I’ve gotten around to tweaking the original source and the example to be particularly useful for Flash Lite.
It turns out that there really wasn’t much to change, but since posting a revised copy is much easier than explaining what to change over and over, here you go.
To use the files, just drop all three in a directory on a webserver running PHP. You should only need to modify the jpg2swf.php file. You just supply a URL and you are off to the races. When laziness is beaten back once more, I really need to add support for the GD libraries to resize images, auto rotate them and do all the other fun stuff that GD 2 does.
Thanks to Henri who mercifully ended my confusion on several PHP things.
Digg this!
September 22nd, 2005 at 2:56 pm
[…] ! Coverwitch September 21, 2005: I Can Tell Your Bag is Fake September 20, 2005: Flash Lite JPG2SF source September 19, 2005: Diary of an ADD […]
September 23rd, 2005 at 4:40 am
This is great Justin i was using swf tools to convert images but on the linux server i had no chance, Now all i need is to figure how this works.
October 25th, 2005 at 6:59 am
Hi.
Im attempting to run the jpg2swf code on IIS.
I can run PHP files without a problem but when I use the jpg2swf code all I get back when called is a bunch of jibberish in the browser.
Also, what should populate the . $_GET[”id”]; section ?
example return
FWSuhp` CÿÿÿÿÙÿØÿØÿàJFIFHHÿÛC ÿÛC ÿÀp–ÿÄÿÄK”#2BR br3Cs‚!$%1AQcƒ’¢£³ÂÒÓð4S“²ÃâDaq”áãÿÄ ÿÄ#!1”2AÿÚ ?ù fn‘/ý8P¸gÏDê¶¾zμoDàiܬ?pó(˜7»Ó¹„Êp˜ºTÔÂL Ä3:a&OHkŠŸ’nj©£–q ¼³Dêì~ä‡a–‹Afžk)¤#§çÚ o³É{v¨Ôv KS󔜒zAÖŠ—.ž»x`ƒWH€¶2·ÆgŠ©ŸB`‡J¯4ô2~99°Ó Pl?¾ Â>õÚé7”Œó+f æ“D–G BÜ¥Up›]Ž=ŸŽE+G7· Ü“ ÿHÊœÈfïAÜšjn»¡tÕe •¨+XÑ1v*à•A`Åö%Xo죀̶F ¶Í4y6n8‚‘ñÕaªgT•¸MJTKªóIq¬D$tˆÁ2™ƒë½.Ó A;TÙÓíBL¬£[µ$Ê€ìüìjX„G’:ü½%EºyxCÜŽ„1Úm# ¤Õü7ØŠ26íˤÊH[¨¡Y`žéžÿr¸áçË1vÚà`Ü˧ “™,šÄD[êXuÇRgøÂÞ\ ¢¬
December 15th, 2005 at 4:57 am
hi justin,
i’m using flashwriter toolkit provided by u and it is generating the swf.
But when i try to load it into the flashlite it is giving me an error. so any settings required for this problem.
January 27th, 2006 at 12:37 pm
amit, what is the error code it is giving?
May 18th, 2006 at 2:05 pm
[…] obe customer showcase. Alen Alebic released jpg2Liteswf a handy little tool based on some work by Justin Everett-Church t […]