I’m finally taking a serious crack at Windows icon importing/exporting in Icon Machine. My plan had been to use FreeImage, since it seemed to be a good open-source implementation. The first obstacle I ran into was that the open source nature of the code made it tricky to get it to work in CodeWarrior. While I had converted Icon Machine to Mach-O, I hadn’t made the switch to XCode yet.
Now I’m in a position to try this again. Things are still complicated, though. 32-bit icons are working reasonably well, but indexed images are trickier. I’ve been tempted to just dump indexed images since they seem old-fashioned, but then there would be lots of icon files that Icon Machine couldn’t open. So I decided to go all the way.
The next problem is translating between the FreeImage API and the Quartz and NSImage APIs. At this point I’m not entirely sure how to get the transparency data for an indexed image, and it’s enough to get me thinking I may as well eliminate the FreeImage layer. The purpose of FreeImage is actually to give a common interface to a variety of image formats, so using it for only one format isn’t quite so useful.
There’s a bunch more stuff planned for Icon Machine 4. Originally, I designed it closely around the Mac OS icon format. Now I’m rethinking it, with a more generalized definition of what an icon is. This ought to enable me to keep up with things for a while yet.