There are a few scripts floating around that allow you to extract layers from a PSD file and save them into individual PNGs or JPEGs. What they all seem to have in common is:
1) Require the GUI (i.e. don't give the option run in non-interactive mode)
2) As a result of (1), don't allow for filename selection from command line by giving the path to the file
3) They all trim the new images to remove extra space around the image and therefore lose the positioning of the layer
4) Auto-generate names for the new images rather than use the existing name of the layer.
I've tried doing the above using a combination of PIL and Imagemagick with some success, but sometimes one or the other chokes on some PSD files. GIMP seems to have no problem reading any PSD file I throw at it, but again, with the above limitations.
So I'm looking for something like:
gimp -i -b '(extract-layers-for-martin "/path/to/photoshop-file.psd")'
Anybody have a script that does the following or knows how to amend an existing one that's out there? (Saul Goode has a great script that works, but it doesn't meet conditions 1-4).