I've been working on a theoretically simple web service to convert PSD or AI files to jpeg, png or some web-compatible format.
I was able to successfully use ImageMagic's
convert -flatten sample.ai sample-ai.jpg command, but consistently getting "invalid header" for various attempts using PhotoShop PSDs. I'm assuming ImageMagick prefers it's own or GIMP-saved PSD files, though perhaps I'm missing something there.
Also tried installing NConvert, but had problems with glibc version on client's CentOS 5.8, which I'm not permitted to change.
In any case, GIMP seems to have good PSD support. More than enough to flatten an image and save it. They've also recently updated their PSD parser. I've seen a similar question but
- that's on windows,
- they didn't really answer anything for GIMP,
- neither convert nor mogrify works for me
mogrify: Improper image header 'Test1.psd'.
So, does anyone know how to write a conversion script in Gimp via command line? I'm looking at this article trying to figure out the commands, but I think my trouble is I don't know ScriptFu worth anything.
It would also be tremendously helpful if I can echo back the dimensions of the original PSD, but I can get these from the resulting file fairly easily with a second step.
convert sample.psd sample.jpg. The
index is to get the resulting image (all the layers merged on in image.)