Running a batch resizing an image which is inside the same folder as the ImageMagic files works. BUT I want to be able to use a batch file from outside the folder containing the ImageMagic files. Normally with other CMD programs I do this by adding a path within Windows's Environmental Variables and this works great, but with ImageMagic done this way it tells me: "Invalid Parameter - -resize" (which as I said the same batch file within the programs folder works fine)
Any idea why this happens?
Portable version adding to Windows's Environmental Variables problem
-
- Posts: 3
- Joined: 2016-09-14T09:21:29-07:00
- Authentication code: 1151
Re: Portable version adding to Windows's Environmental Variables problem
It is probably calling the windows program called convert and that does not have a resize option.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Portable version adding to Windows's Environmental Variables problem
As Bonzo says. That message comes from the Microsoft program, not ImageMagick.
The cure is either to add IM's directory to your system path, or to always call "convert" with an explicit path.
The cure is either to add IM's directory to your system path, or to always call "convert" with an explicit path.
snibgo's IM pages: im.snibgo.com
-
- Posts: 3
- Joined: 2016-09-14T09:21:29-07:00
- Authentication code: 1151
Re: Portable version adding to Windows's Environmental Variables problem
Thank you very much guys explicit/absolute path solved the problem
instead of:
I have this now and this works well:
instead of:
Code: Select all
for %%a in ("*.PNG") do convert.exe "%%a" -resize 1920x1080 "%%~na.PNG"
Code: Select all
for %%a in ("*.PNG") do "c:\Program Files (x86)\Batch Files\convert.exe" "%%a" -resize 1920x1080 "%%~na.PNG"
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Portable version adding to Windows's Environmental Variables problem
That's it. But I suggest you use an environment variable for the path. Eg, have a system-wide variable called IM set to c:\Program Files (x86)\Batch Files\
and then call "%IM%convert".
and then call "%IM%convert".
snibgo's IM pages: im.snibgo.com
-
- Posts: 3
- Joined: 2016-09-14T09:21:29-07:00
- Authentication code: 1151
Re: Portable version adding to Windows's Environmental Variables problem
This works great, thanks a lot!snibgo wrote:That's it. But I suggest you use an environment variable for the path. Eg, have a system-wide variable called IM set to c:\Program Files (x86)\Batch Files\
and then call "%IM%convert".