Monthly Archive for July, 2006

Task Manager

Today I departed on a search for a task manager (AKA To-Do list) for os x that would suite my fancy. I guess I’m pretty picky because I didn’t really find anything computer application I really liked. Most of the applications I found were either too tied to iCal (which I don’t use at all), made 2+ years ago and haven’t been updated since, just to complicated to be simply a glorified to-do list, or just plain ugly to look at. I guess I’m more picky than most when it comes to Mac applications: I want a great looking fully functional Cocoa based mac application.

My search finally ended, but instead of finding a mac application to suite my needs, I found a nifty little web-application; GTDTiddlyWiki. Now I guess this Javascript based wiki isn’t a web-application per-say since it is meant to be run locally on your computer and is totally self contained having no connections with any sort of external database of service. In any case GTDTiddlyWiki is a great way to organize and keep track of your tasks and thoughts.

Two Web-Dev Tips

Applying Filters To a Loaded Image

I haven’t done any Flash work in awhile, and I guess I forgot the amount of quirks it has (although its getting much better).
Applying filters to a loaded image doesn’t work. I loaded a MC using this code:

var loader = new MovieClipLoader();
var listener = {onLoadInit:Delegate.create(this, imageLoaded)};
loader.addListener(listener);
loader.loadClip("pic.png", holder);

Then tried to apply a filter like so:

var blur = new flash.filters.BlurFilter(30, 0, 3);
holder.filters = [blur];

But nothing happened. The filter works fine on a MC containing a image from the library. The solution? Well, after about 30 minutes of banging my head against the wall trying to get it work I figured I’d try wrapping the image in another MC and then applying the filter wrapper MC. Walla, filter is applied. Why Macromedia, why cant you just make a simple note in the

filters

help page noting that filters cannot be applied to loaded images?

Changing PHP Ini Variables of PHP Running as CGI

Changing PHP ini variables using php_value or SetEnv does not work when running PHP as CGI. You need to run PHP apache for those tricks to work.

Transparent PNG To JPG Conversion

Converting a semi-transparent PNG to a JPG without severe artifacts or “transparent area color meshing” is a much harder task than you would expect. I thought it would be as simple as loading the image into Image_Transform and using

_generate(null, 'jpg')

to convert the image to a jpeg. Well, that code will convert it to a jpeg, but all the areas that are semi-transparent end up looking absolutely horrible becoming sort of flattened. The solution is to use the wonderful Image Magick image processing library to draw the image onto a background color of your choice:

header("Content-Type: image/jpeg");
list($width, $height) = getimagesize($pic);
//the below function should be passthru, but for some reason WP would not let me write that in...
passthr("convert -size ".escapeshellarg($width."x".$height)." -draw 'image Over 0,0 0,0 ".realpath($pic)."' xc:white jpg:-");

The above PHP script successfully converts a semi-transparent PNG to a jpeg with a white background (obviously, you need to have passthru() enabled for this script to work). You can change the background color by changing the

xc:white

part of the shell script to whatever color suites your needs (

xc:gray

, for example). The original shell script was taken from here.

As an aside, learning to use the Image Magick command line tools isn’t an easy task. The command syntax is very unorthodox and it very confusing. I found the following resources very useful while trying to learn the Image Magick CLI:

Back From Retreat

Just got back from a three day church retreat at Stuebenville Ohio (which was an awesome experience).

I’m happy to be back and have alot of new things in the pipeline. Within the next couple weeks I should have the following available:

  • XASH 1.3 (you can actually download it from the SVN repo right now)
  • XTrace 1.1
  • App Stop 1.2 (with intel compatibility!)
  • A few PHP scripts along with some new AS classes

XTrace Subversion Repository

Continuing with the trend of moving all my projects to using SVN, a repo for XTrace is now available. You can checkout the latest source with the following command:

svn co http://svn.mabwebdesign.com/XTrace/

For anyone using TextMate as their primary editor, you should checkout this article which explains how to use XTrace, TextMate, and MTASC to create a slick Flash dev environment.