Resize images and move them to another folder with specific name

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
yoni@catom.com
Posts: 3
Joined: 2015-05-20T23:30:26-07:00
Authentication code: 6789

Resize images and move them to another folder with specific name

Post 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?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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".
snibgo's IM pages: im.snibgo.com
Post Reply