image -resize commandline Windows Server 2012 r2

风流意气都作罢 提交于 2019-12-12 01:52:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!