Re: [newbie] Batch Resizing of icons.
On Thursday 26 August 2004 07:38, Lanman wrote: Hoyt Bailey wrote: On Thursday 26 August 2004 06:50, 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. TIA, Lanman If there is some way you can simply identify the size 'sed' probably could do it. Hoyt, I know the exact sizes and there are 4 of them. All these images each need to be resized to the four fixed sizes. Can you give me some info re - sed? I need to be able to input a command for multiple images at one time, and hopefully so have sed send the output to 4 different folders - 1 for each of the sizes. TIA Lanman I'm not sure how icons are sized. If there is a 'size:40' then you can convert that to any size you want by finding /size: 40/ and replacing that with /size: 50/ any time it occurs in as many files as exist say you have Chapter01 thru Chapter50, then every regexp can be changed to newregexp by 'sed'. Its been a number of years since I have used sed and I dont remember the syntax but it goes something like this: cat /dirpath/* | sed /size: 40/r/size: 50/ tee /newdirpath sed is a stream editor and cat is necessary to stream the data. Do not use the syntax I have shown more may be required or different may be required I just dont remember. See man sed or info sed. -- Regards: Hoyt Registered Linux User # 363264 http://counter.li.org Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com
Re: [newbie] Batch Resizing of icons.
Hoyt Bailey wrote: On Thursday 26 August 2004 07:38, Lanman wrote: Hoyt Bailey wrote: On Thursday 26 August 2004 06:50, 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. TIA, Lanman If there is some way you can simply identify the size 'sed' probably could do it. Hoyt, I know the exact sizes and there are 4 of them. All these images each need to be resized to the four fixed sizes. Can you give me some info re - sed? I need to be able to input a command for multiple images at one time, and hopefully so have sed send the output to 4 different folders - 1 for each of the sizes. TIA Lanman I'm not sure how icons are sized. If there is a 'size:40' then you can convert that to any size you want by finding /size: 40/ and replacing that with /size: 50/ any time it occurs in as many files as exist say you have Chapter01 thru Chapter50, then every regexp can be changed to newregexp by 'sed'. Its been a number of years since I have used sed and I dont remember the syntax but it goes something like this: cat /dirpath/* | sed /size: 40/r/size: 50/ tee /newdirpath sed is a stream editor and cat is necessary to stream the data. Do not use the syntax I have shown more may be required or different may be required I just dont remember. See man sed or info sed. Thanks Hoyt. Will give it a shot and send you any info I find or the command that works for your information. Lanman Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com
Re: [newbie] Batch Resizing of icons.
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
Re: [newbie] Batch Resizing of icons.
On Thu, Aug 26, 2004 at 10:37:43AM -0400, Lanman wrote: Hoyt Bailey wrote: On Thursday 26 August 2004 07:38, Lanman wrote: Hoyt Bailey wrote: On Thursday 26 August 2004 06:50, 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. TIA, Lanman If there is some way you can simply identify the size 'sed' probably could do it. Hoyt, I know the exact sizes and there are 4 of them. All these images each need to be resized to the four fixed sizes. Can you give me some info re - sed? I need to be able to input a command for multiple images at one time, and hopefully so have sed send the output to 4 different folders - 1 for each of the sizes. TIA Lanman I'm not sure how icons are sized. If there is a 'size:40' then you can convert that to any size you want by finding /size: 40/ and replacing that with /size: 50/ any time it occurs in as many files as exist say you have Chapter01 thru Chapter50, then every regexp can be changed to newregexp by 'sed'. Its been a number of years since I have used sed and I dont remember the syntax but it goes something like this: cat /dirpath/* | sed /size: 40/r/size: 50/ tee /newdirpath sed is a stream editor and cat is necessary to stream the data. Do not use the syntax I have shown more may be required or different may be required I just dont remember. See man sed or info sed. Thanks Hoyt. Will give it a shot and send you any info I find or the command that works for your information. sed is a stream editor and will not work with images. Todd -- Name that tune #21: I live in the ghetto, you just come to visit me around election time. Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com