Page 1 of 1

Resize images and move them to another folder with specific name

Posted: 2015-05-20T23:35:40-07:00
by yoni@catom.com
i have this

Code: Select all

mogrify -resize 200 -path images/../test/ images/*.*
works great
i need to change the output file name so instead of image.jpg it will be image_big.jpg

tried this:

Code: Select all

mogrify -resize 200 -format %t_big.%e -path images/../test/ images/*.*
but the i get the file name like this: image._big.jpg or something like this

so i tried convert command:

Code: Select all

convert images/*.jpg -resize 200 images/../test/
this does not work

Code: Select all

convert images/*.jpg -resize 200 images/../test/*.*
this takes the image.jpg and the output is -0 without extenstion
if i change -0 to -0.jpg than i get the file i needed with the right extenstion
but now the -format is not working at all

what can be done?

Re: Resize images and move them to another folder with specific name

Posted: 2015-05-21T20:55:33-07:00
by snibgo
Mogrify won't change filenames, apart from the extension (the part after the final ".") with "-format".

Convert can take many inputs but uses one filename for all the outputs, with -0, -1 etc if needed.

So I would do the job with a shell script to loop through all the files, using convert and "-set filename".