views:

188

answers:

2

I'd like to script printing of a series of photographs, but to exact dimensions. (e.g. all jpegs in dir /tmp/printing, at 1.5" x 1.0", 6 to a page)

I happen to have my hands on a Ubuntu Linux box and a deskjet printer (hp5150) but could probably use Windows or possibly get another printer if absolutely required.

I'm reasonably familiar with shell scripting but I'm not having much luck finding a command line method of printing photos while specifying the target dimensions. GIMP seemed an obvious choice but my google-fu and general fiddling hasn't shown me how to do it.

Can anyone help (preferably with an example :)! ).

Thanks!

EDIT: Thanks to PEZ, I have a mechanism for printing mutiple images to a sheet, but I can't see how to resize images to set dimension, even using ImageMajick. I can resize to a dimension specified in pixels, is it a case of determining (or setting?) the DPI of the printer and calculating the pixel dimensions to get the printed dimensions?

+1  A: 

I don't have my hands on a Linux box right now, but I think it should work to use something like ImageMagick (the "convert" command) to scale to images and then use the n-up printing of CUPS to print the images. The print command would look something like so:

lp -o number-up=6 my_scaled_image_*.jpg
PEZ
thanks, that looks like a good mechanism. I can only see a way to resize to a dimension in pixels, do I need to know or find out the DPI of the printer and work it out from there?
Colin Pickard
Do you know the DPI of the images? More importantly, do they share the same DPI? If so you can hardcode the pixel size of your scaled images. Say you have images of 150 DPI. Then they should be 150 X 100 pixels.
PEZ
If they are of different resolutions you can resample them to 150 DPI first, then scale, then print. Take a look at the -resample option.
PEZ
brilliant. I'll continue having a fiddle with it and post my finished script.
Colin Pickard
A: 

Check out this site for batch processing in GIMP: http://gimp.org/tutorials/Basic_Batch/