Page 1 of 1

use mogrify on folder with multiple image formats?

Posted: 2015-07-14T19:45:36-07:00
by josephaaroncampbell
Hello!

So I know how to use the following command to batch convert a folder of images:

mogrify -format jpeg *.png

But what if the folder of images I want to convert also has '.tif' or '.dng' included as well? Is there another option for ' *.png " that will include any file type? tried the following but it just throws a couple errors:

' mogrify -format jp2 *.png *.tif *.dng' ??

-error unable to open image '*tif': Invalid argument @ error/blob.c/OpenBlob/2697
-error unable to open image '*dng': Invalid argument @ error/blob.c/OpenBlob/2697
-no decode delegate for this image format '' @ error/constitute.c/ReadImage/501


Thank You!

using ImageMagick-6.9.1-Q16-HDRI
windows 7 64 bit

Re: use mogrify on folder with multiple image formats?

Posted: 2015-07-14T20:39:04-07:00
by fmw42
use * at the end to process all files

Code: Select all

mogrify -format jp2 *
but I urge you to save to a different folder using -path option so you do not overwrite your input images in case of error.

This also works for me to just process png and tif

Code: Select all

cd /Users/fred/desktop/test1
mogrify -path ../test2 -format jpg '*.png' '*.tif'


Re: use mogrify on folder with multiple image formats?

Posted: 2015-07-14T22:38:04-07:00
by josephaaroncampbell
Thank You fmw42! this worked just as I needed it to. The path was something on my list to add so thank you for that information as well.