input/output filenames and paths

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
samIam
Posts: 5
Joined: 2016-02-20T09:02:44-07:00
Authentication code: 1151

input/output filenames and paths

Post by samIam »

Very new to this and trying to figure out how to handle folders/directories on windows.

If I have this batch file in the same directory as the image, it works great:
montage -label "Bottom SC" *.jpg -geometry +0+0 -pointsize 200 -background Gold 1btmSC.jpg

However, I need to get it to where the batch file can be located in a different folder/directory than the image. But as soon as I add a path to my command line, it doesn't work anymore:

montage -label "Bottom SC" 'C:\TIApic\1btmSC\*.jpg' -geometry +0+0 -pointsize 200 -background Gold 1btmSC.jpg
or
montage -label "Bottom SC" 'C:\TIApic\1btmSC\*.jpg' -geometry +0+0 -pointsize 200 -background Gold 'C:\TIApic\1btmSC\1btmSC.jpg'

I tried " or ' or no quotes at all. Any pointers?
Thanks
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: input/output filenames and paths

Post by glennrp »

Read the "Using the DOS Shell and Batch Files" section at http://www.imagemagick.org/Usage/windows/
Maybe the answer is there.
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: input/output filenames and paths

Post by GeeMack »

samIam wrote:Very new to this and trying to figure out how to handle folders/directories on windows. [...] Any pointers?
Maybe take a look at the Windows "pushd" command to get your batch file to change directory.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: input/output filenames and paths

Post by fmw42 »

What is ???? in your command?

Please, always provide your IM version and platform when asking questions, since syntax may differ.

See viewtopic.php?f=1&t=9620
samIam
Posts: 5
Joined: 2016-02-20T09:02:44-07:00
Authentication code: 1151

Re: input/output filenames and paths

Post by samIam »

I am not sure what happened when I pasted the lines into the post - the ???? were 'g o l d'. Not sure why you cannot say that word here....

But it is working now - double quotes ("), instead of single:
montage -label "Bottom SC" "C:\TIApic\1btmSC\*.jpg" -geometry +0+0 -pointsize 200 -background Gold 1btmSC.jpg

This allows me to essentially 'grab' a file from the 1btmSC folder, label it and place it in the active folder. That's exactly what I was looking for.

Thanks for the help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: input/output filenames and paths

Post by fmw42 »

I am believe that Windows (batch?) needs double quotes. See http://www.imagemagick.org/Usage/windows/
Post Reply