问题
I've just updated Windows Server 8 to Windows Server 2012 R2 and got a problem with the image -resize command. I've installed ImageMagick but still having the same error
Here's my command
FOR %%a IN (*.jpg) DO convert "%%a" -resize 2000x2586! -define jpg:extent=700k "%productImageDir%\zoom\%%a"
call:doProgress
and here's the error I'm getting when I run it on cmd
Invalid Parameter - -resize
回答1:
There is a Microsoft CONVERT.EXE that name-clashes with ImageMagick convert. Because of your PATH, you are calling the Microsoft one which doesn't understand the ImageMagick parameters.
The best way to avoid problems is to use magick in place of convert
magick "%%a" -resize 2000x2586! -define jpg:extent=700k "%productImageDir%\zoom\%%a"
The second best way to avoid problems is to correct your PATH so that the ImageMagick directory appears in your PATH before C:\WINDOWS\SYSTEM32.
来源:https://stackoverflow.com/questions/43248154/image-resize-commandline-windows-server-2012-r2