convert command-line not working

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
williamj
Posts: 5
Joined: 2016-05-02T18:35:30-07:00
Authentication code: 1151

convert command-line not working

Post by williamj »

Hello,

What am I doing wrong?

"convert.exe" "E:\ProgramData\scanned books\new books\self modifying systems\1_Dir\1_Picture2.jpg" "E:\ProgramData\scanned books\new books\self modifying systems\gifs\1_Picture2.gif"

Standard error states:

Invalid Parameter - books\new

Any suggestions?

williamj
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: convert command-line not working

Post by GeeMack »

williamj wrote:Any suggestions?j
You're executing your Windows "convert" command. You need to call up the IM "convert" command by using its full path, or a generally better option is to put the IM directory in your PATH somewhere before the Windows/System directory. Then when you call up "convert" from the command line it finds the IM version first and runs it.
williamj
Posts: 5
Joined: 2016-05-02T18:35:30-07:00
Authentication code: 1151

Re: convert command-line not working

Post by williamj »

Still getting the same error with convert and IM in path.

convert "E:\ProgramData\scanned books\new books\self modifying systems\1_Dir\1_Picture1.jpg" "E:\ProgramData\scanned books\new books\self modifying systems\1_Dir\1_Picture1.gif"

Returns:

Invalid Parameter - books\new

williamj
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert command-line not working

Post by fmw42 »

Quoting should work, but try renaming your folders to remove the spaces and see if that works.

Or cd to E: and leave out the paths and see if that works

Please always provide your IM version and platform and OS.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert command-line not working

Post by snibgo »

williamj wrote:Still getting the same error with convert and IM in path.

...

Invalid Parameter - books\new
You are still running the wrong program. "Invalid Parameter" comes from the Microsoft program. Your path is wrong.
snibgo's IM pages: im.snibgo.com
williamj
Posts: 5
Joined: 2016-05-02T18:35:30-07:00
Authentication code: 1151

Re: convert command-line not working

Post by williamj »

Hello,

I am now getting:

Invalid Parameter - 1.gif

For this command-line arg:

convert 1_Picture1.jpg 1.gif

I also tried the same file name with a .gif suffix.

williamj

:o
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert command-line not working

Post by fmw42 »

The above people are trying to tell you that there are two different convert programs. One comes with Windows, the other comes with Imagemagick. You are apparently using the Windows convert. You need to find where you have installed Imagemagick and the put the full path to convert in your command.

Code: Select all

path2/convert path2/image.jpg path2/image.gif
Or rename the Imagemagick convert to im_convert or something like that and use that. Or put the path to Imagemagick convert's directory at the beginning of your environment PATH.
williamj
Posts: 5
Joined: 2016-05-02T18:35:30-07:00
Authentication code: 1151

Re: convert command-line not working

Post by williamj »

Ok. I'm confused.

Where is convert located?

Where is the ImageMagick command-prompt .bat file located?

williamj
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert command-line not working

Post by snibgo »

The ImageMagick program convert.exe is put in whatever directory you gave when you installed it. You can see where that is if you re-run the installation process (without actually reinstalling). If you type:

Code: Select all

where convert.exe
... this should list all the "convert.exe" programs on your system path. When I type it, it shows:

Code: Select all

C:\cygwin64\bin\convert.exe
C:\Windows\System32\convert.exe
So, if I type "convert", I will get the IM program because that is the first on the list.
snibgo's IM pages: im.snibgo.com
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: convert command-line not working

Post by Bonzo »

If you allow the install program to add the imagemagick path to the envirometal variables path on installation you should not have a problem.
williamj
Posts: 5
Joined: 2016-05-02T18:35:30-07:00
Authentication code: 1151

Re: convert command-line not working

Post by williamj »

Hello,

I managed to get Magick.Net to work.

Thanks for your assistance.

williamj
Post Reply