Problem when run convert in bat-file

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
keoe
Posts: 2
Joined: 2013-10-14T04:36:25-07:00
Authentication code: 6789

Problem when run convert in bat-file

Post by keoe »

I run ImageMagick version 6.8.7 on Windows 7.

When I run

Code: Select all

convert C:\Photo.jpg -thumbnail 150x100^^ -gravity center -crop 150x100+0+0 +repage -format jpg -quality 75 C:\thumbs\Photo_thumb.jpg
i the command promt, it's work fine. When I try to run this in a bat-fil I get the following message: Invalid parameter - -thumbnail.

Does anyone know what's wrong?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Problem when run convert in bat-file

Post by snibgo »

"Invalid parameter - -thumbnail" is a message from the Windows utility "convert.exe", not the ImageMagick "convert.exe". You are calling the wrong program.

You can either:

- change your path enviroment variable so the IM path is before the Windows path
- rename IM convert.exe to, for example, imconvert.exe
- call convert.exe with a full path.
snibgo's IM pages: im.snibgo.com
keoe
Posts: 2
Joined: 2013-10-14T04:36:25-07:00
Authentication code: 6789

Re: Problem when run convert in bat-file

Post by keoe »

snibgo wrote:"Invalid parameter - -thumbnail" is a message from the Windows utility "convert.exe", not the ImageMagick "convert.exe". You are calling the wrong program.

You can either:

- change your path enviroment variable so the IM path is before the Windows path
- rename IM convert.exe to, for example, imconvert.exe
- call convert.exe with a full path.
Thank you! That solve my problem
Post Reply