On Thu, Aug 26, 2004 at 07:50:24AM -0400, Lanman wrote: > Does anyone know of a way to resize a batch of icons all at once? I've > been looking at Imagemagick, but can't get the command-line to work > properly. There seems to be some options or info missing from the > Man-Page for it, and I can't find any other info on the correct procedure. > > I have several folders of images which need to be resized into several > different sizes, so being able to resize recursively through several > folders and sub-folders would be handy as well.
Imagemagick is made up of a bunch of commands like mogrify and convert (there are more, I think). A lot of times I just use mogrify to resize, but convert will do resizing too. The basic command for resizing is: mogrify -geometry WxH image.png where W is width and H is height (in pixels). Note that this will overwrite the image, so if you want to keep the originals, be sure to copy them. If the aspect ratio doesn't allow you to resize in the dimensions you want, use ! to force the size (distortion will occur), i.e. -geometry 40x35! . Doing this in batch depends on the picture names and whether you've got spaces in the names (or the folders). With no spaces in names or folders, something like for image in `find /path/to/search -type f -iname '*.jpg' -o -iname '*.png'` # (whatever extension(s) you need) do mogrify -geometry 16x16 "$image" done should do the trick. Find will recurse directories for you; the only issue is if filenames/folders have spaces in them. Todd -- Anybody but a Republican or Democrat 2004
____________________________________________________ Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com ____________________________________________________