Oct 4, 2007 10:28 pm
Wow, has it been a long time since my last post. A lot has happened since then.
First things first, I started a new job! I left the friendly confines of Tribal DDB and the lucrative world of advertising, and accepted a job as a Flash Developer with Yahoo! here in Dallas. I've just completed my first month there, and everything is going great so far. Everybody I work with is super smart, and everyone is good at what they do. I definitely feel like I am going to learn a lot. My fooseball skills should improve as well....
I do miss all the wonderful folks at Tribal though, and wish them all the best.
Secondly, the flash world is really abuzz right now, especially since all the sneak previews of the next version of the Flash player and IDE. Object based timeline, C/C++ integration (?!?!), native 3D, Hydra, rigging....wow. Add to that H.264 support, and you have a ton to be excited about my friend. The Flash dev team at Adobe has been hard at work, and it shows.
Jan 25, 2007 9:47 pm
The current project I am working on at work involves a shit load of assets rendered with a 3D program. I had over 430 Targa images with an alpha channel that needed to have that channel applied, trimmed, saved out as a 32-bit PNG, then taken in to Fireworks to be exported as an 8-bit PNG with alpha transparency.
Not only that, but I had PSD's that contained basically 2 layer groups and a background layer. I needed to save out a JPG for every combination of layers in those 2 groups. It will turn out to be almost 800 JPG's!
Now I could have done all this by hand, but A, I really didnt want to, and B, it would probably take me a full week to do it. And then what happens if we need to change something on one of the images, or save them out with different compression?
As soon as I received all these assets, I knew this would be the perfect opportunity to explore the scripting capabilities of both Photoshop and Fireworks. Both programs provide a JavaScript API that gives you access to open document DOM's, the OS's file system, and just about every command and tool available. If you have some time to spare, I highly suggest checking out the documentation for both programs. It can save you a lot of work.
The Photoshop JavaScript API is without a doubt wonderful. Its powerful, well documented, seems well thought out, and, if you are familiar with JavaScript, is rather easy to figure out. Within a matter of hours, I was able to write a script to do exactly what I needed to do. References guides (pdf format) are included in your Photoshop install under Program Files\Adobe\Adobe Photoshop CS2\Scripting Guide\.
The Fireworks API, while equally powerful, was a bit more difficult to get the hang of. The documentation is sparse, and the lack of examples is a little frustrating at times. It took me much longer to write a script that accomplished a seemingly simpler task. The most frustration came from an error in the scripting documentation. It states that paletteTransparencyType is a property of an ExportOptions object that can be set to "none", "index", "index alpha", or "rgba". After a few hours of trouble shooting and a lot of head scratching, I used the "Save as Command" command in the history palette to look at the JS generated by Fireworks itself. So yeah....there is no paletteTransparencyType. It is in fact just paletteTransparency. After figuring that out, everything ran smoothly.
Posted by John Van Horn
Filed in General
Jan 17, 2007 8:16 pm
I had avoided installing IE7 on my desktop computer at home until tonight. I installed it a few weeks ago on my laptop without incident, so tonight, when the Windows update prompted me to confirm installation, I thought "mind as well."
Yeah....well, after about 10 restarts and over an hour googling for fixes, and rummaging through MS's knowledgebase, I have uninstalled IE7 and rolled back to 6. The damn thing crashed every time i started it.
I tried a number of suggestions found on the web, but to no avail. One of them was to use the System Restore to roll back XP to a stable point, but even that failed on 3 occasions, with 3 different restore points.
Frankly, I am a bit irritated right now, since I am starting to code an original layout for this blog.
Posted by John Van Horn
Filed in General
Jan 15, 2007 11:57 pm
Well, I guess I shouldn't call it a battle... it wasn't all that bad. I'm sure that if i knew PHP, it would have been a breeze.
I wasn't totally happy with Textpattern's default date format options, and I could not find a plugin, tutorial, or forum discussion on the topic. All the options in Admin>Preferences>Date Format displayed a 24-hour clock, which was annoying the shit out of me. I just wanted a simple 12 hour format... something like 'Jan 16 2007, 4:36 pm'.
I guess I could explain exactly the process I went through to fix this, but that would be rather boring. Besides, if you're reading this, you may want to actually do this, and are looking for a simple explanation.
To make a long story short, I guess my server's (dreamhost) C library does not support the '%p' format when used in a date-format-string and then passed to the strftime() function. On my server, strftime('%p') was returning an empty string. That caused Textpattern to use the 24 hour clock for all date formats.
To solve this, I found the dateformats function located in textpattern/include/txp_prefs.php. At the end of the function, just before the return, I added a key to the array $vals. That displayed antother option in the drop down list in Textpattern's preferences. This is the line I added:
$vals['12 hour'] = 'Custom 12 hour';
Then I had to build my custom format. I found a function, safe_strftime located in textpattern/lib/txplib_misc.php that actually built the dates from the selection in the prefs. Near the end of that function, before the UTF check and charset jazz, I added a conditional block:
if ($format == '12 hour')
{
$str = date('M j, Y g:i a', $time + tz_offset());
}
And that did it. I uploaded those two files, set the preferences, and it worked like a charm.
Now, if I could just get IE7 to stop f'in up my layout.....
Posted by John Van Horn
Filed in General