Resize and Keep filename

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
fsa317
Posts: 1
Joined: 2014-03-26T06:22:56-07:00
Authentication code: 6789

Resize and Keep filename

Post by fsa317 »

I know what I'm asking sounds really simple and I bet there is a simple solution, but I havent found one yet. I want to resize all images in a folder, keeping aspect ration and setting a max width of 400. However if the image is already smaller than 400 width I dont want to touch it. Most importantly I dont want to change the filename of the files.

I found this command:

Code: Select all

mogrify *.* -resize "400" *
But I also found someone saying this was bad b/c the files were processed twice.

What is the best way to do what I'm trying to do?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Resize and Keep filename

Post by snibgo »

Code: Select all

mogrify -verbose -resize "40>" *.jpeg
I include "-verbose" to see if files are processed twice. They don't seem to be.

For the ">" flag, see http://www.imagemagick.org/script/comma ... p#geometry
snibgo's IM pages: im.snibgo.com
Post Reply