Page 1 of 1

Mogrify - Specify Input Folder

Posted: 2011-08-01T12:40:43-07:00
by pjvedder
This may be a stupid question, so I apologize in advance... I couldn't find it anywhere in the documentation, but how do you specify which folder's images you want mogrify to process? I'm running ImageMagick through coldfusion, so this is my mogrify call:

Code: Select all

<cfexecute name="C:\Program Files\ImageMagick-6.7.0-Q16\MagickCMD.exe"
arguments='mogrify -format jpg *.eps'
timeout="5000"
variable="debugReport"
/>
I saw there was an option called "-path" where I believe it specifies the output, but what about input? When I ran the above code as is, I couldn't get it to process any images, no matter where I placed them (in the ImageMagick folder, in the folder where the script is run, etc.)

Re: Mogrify - Specify Input Folder

Posted: 2011-08-01T12:59:43-07:00
by fmw42
you have to cd to the folder you want to process and use -path for the folder to place the output images if other than the current folder.

Re: Mogrify - Specify Input Folder

Posted: 2011-08-01T13:36:24-07:00
by pjvedder
I don't think I can do that in ColdFusion. There's no way to cd to a directory, as far as I know.. ColdFusion doesn't work like that.

I'm pretty surprised mogrify doesn't have an path or folder input option/parameter. It seems like it makes mogrify basically unusable when executing an IM script from ColdFusion. Now I just have to hope a large loop with a ton of converts doesn't make me run out of memory.

Thanks for you help, though.

Re: Mogrify - Specify Input Folder

Posted: 2011-08-01T18:39:31-07:00
by anthony
You can specify the input path as part of the image read.

mogrify -format jpg -path output_folder/ input_folder/*.eps

Re: Mogrify - Specify Input Folder

Posted: 2011-08-01T20:06:34-07:00
by fmw42
I stand corrected. Learned something new today!

Re: Mogrify - Specify Input Folder

Posted: 2011-08-02T06:51:28-07:00
by pjvedder
Works like a charm! Thanks!!

Re: Mogrify - Specify Input Folder

Posted: 2011-08-02T07:00:50-07:00
by anthony
I thought it was so obvious that I had even thought to put it in the IM Examples.

Basically the -path setting in "mogrify" replaces any input directory component of the input file.
If not given the normal input directory is left as is.

Similarly -format replaces the suffix and codec component of the input file.

I plan to look at more specific -set options for use in "convert" in the IMv7, command line overhaul what do similar things to the 'saved' filename. These 'settings are currently accessible in "convert" using %{single letter} options, but -set does not let you 'set' them :-(