|
BIRME – Batch Image Resizing Made Easy
The story behind As a web developer, I often need to resize images into a specific dimension to suit the website’s design. I used to resize images in Photoshop but I find it tedious to record actions again and again for different websites. Besides that, Photoshop is not cheap and not everyone has a (legal) copy. I tried some existing software but none of them satisfied me. Therefore, I decided to write one myself . I’ve been searching and testing with many different platforms to develop it, C++, Java, Python and Perl. None of the above can achieve what I wanted, a single executable file without any extra libraries or dll files, no installation required. Finally I landed on PHP and I used bamcompile to generate an executable file. I still have troubles to get a Mac or Linux version of any PHP compiler to work. I may re-use my C++ code for Mac in the future and wrap it up as an .app. |
Archive for the ‘Others’ Category
|
How to force server to run php5
Frome: http://www.tech-bits.com/index.php/CategoryID/1/EntryId/130/entry “Some hosting providers are still using php 4 as their default for scripts, but offer php5 as well. To force your scripts to all use php5, you can try adding this to a .htaccess file on your site: AddType x-mapp-php5 .php AddHandler x-mapp-php5 .php “ |
|
Getting Playstation Eye to work with openframeworks
I’ve never seen such clear webcams before! The PS3 Eye is truly amazing! By default, PS3 Eye is not supported by Windows or Mac OSX. Luckily there are drivers ready for you to grab. For PC, use this driver. For Mac OSX, use this driver. To get PS3 Eye working for openframeworks in windows, you need to edit one line in file “ofVideoGrabber”. The solution is found in this thread, changing bool bOk = VI.setupDevice(device, width, height);
bool bOk = VI.setupDevice(device, width, height, VI_COMPOSITE);
For Mac OSX, all you need to do is to copy “maccam.component” into “Library\QuickTime\”, no changes on the source code needed. Enjoy! |
|
Box2D Tutorial
I gave a mini tutorial on Box2D during A-SFUG meeting. You can download it here. Have fun! |
|
Sharing some good PHP stuff: Simple HTML DOM Parser
Most of my Flash projects use XML as “database” and PHP is my preferred server script. I found Simple_HTML_DOM Parser quite a good tool for reading and writing XML files. The default DOM in PHP is quite hard to use. The syntax for creating nodes in PHP is very tiring. Besides that, the biggest headache is that the scripts written for PHP 4 are not compatible with PHP 5. Simple HTML DOM Parser is designed for reading and editing HTML but it works fine with XML files, since XML files are more tidy than HTML. Reading and traversing the XML is easy, just use the find function. $xml = file_get_html('http://www.google.com/');
foreach($xml->find('img') as $element)
echo $element;
Writing a new node is not difficult either. $node = str_get_html('<sample_node>Hello World</sample>');
|
|
Just for fun, try this on Firefox or IE
http://www.shang-liang.com/musicplayer/ Please be patient with my slow server. Thank you! |
|
Update: Configure FlashDevelop Code Autocompletion For AIR API
Previously in Flash CS3, the trick of getting autocompletion in FlashDevelop is not working any more in Flash CS4, ast least not in my case. After testing a while I finally got it working again by setting the swc path of the project. Choose “Project>>Properties…>>Compiler Options>>SWC Include Libraries” and add the path of AIR swc to it. Most likely it would be something like this: “C:\Program Files\Adobe\Adobe Flash CS4\AIK1.5\frameworks\libs\air\airglobal.swc” Cheers! |
|
SWFObject 2.2 and SWFAddress 2.3 Conflict – flashvars have problem in IE
The problem has been noted in SWFObject’s issue log. If you encounter any problem with flashvars not showing up in IE, downgrade SWFAdress to 2.2 will solve the problem. You can download other versions of SWFAdress from SourceForge. |


