Sunday, July 24, 2005

Repeatedly Running My Skull Into A Brick Wall

Unbelievable. I have just spent hours trying to do what I thought would be the most simple of tasks, once I located the tool that I thought could handle the job.

You see, there is a nice collection of totally free (as in Public Domain) clipart available on the internet a Open Clipart Library (aka, openclipart.org). I had referred one of my cowokers to the site when I found it on Friday, as she is always searching for a good source for it. Unfortunately, virtually all the vector images are saved in SVG (Scalable Vector Graphics) format--which neither MS Office 2000 nor OpenOffice.org can import at this time. So what do we have, a library of cool clipart that we cannot use? Time to look for a conversion tool to export them as WMF (Windows Meta File)...

I found one! Or so I'd thought. ImageMagick, a set of GPL licensed command line tools for image manipulation. It was supposed to be as easy as entering convert foo.svg foo.wmf or so one would think on a quick glance at the documentation. I was ready to roll. I would just write a script to recurse through the downloaded library of SVG files and use the convert command to export them a WMF, to the benefit of all MS Office & OpenOffice.org users! Funny thing though, the scripts seemed to run, but nothing was getting converted and I was getting no freshly minted WMF files for my troubles.

I googled, I tweaked, I tried everything I could think of. I went back to the docs a couple of times. It seemed so simple. How in the world could I be screwing this up?! Then I saw it and understood. In the manpage for ImageMagick it list all the various filetypes it can deal with, from PNG to BMP, to my own interest--WMF & SVG. Funny thing though, it was listing attributes next to the filetypes. Something you would associate with permissions.

I happened to notice that WMF was listed with R (read-only in file permissions land), so was WPG: "R". Other types, like PNG had "RW" by them. Then it struck me, this had nothing to do with file permissions at all. This legend was telling me what it could import (R) from and export (W) to! WMF, "R" but no "W". It wasn't going to ever work under this version of ImageMagick because it could not export only import.

AAAAaaaargggh! What a waste of time! I was so focused on being cool with a batch conversion I totally overlooked the obvious.

Well, I am done with this for tonight. I know there is a way out there to get this conversion made, but I am going to have to look elsewhere. As cool as ImageMagick is (and it really is, this is an awesome suite of tools), it's not going to help me here...

No comments: