开发者

ImageMagick: How to use "Only Shrink Larger Images" ('>' flag) both on windows and unix

I found this description on website http://www.imagemagick.org/Usage/resize/#shrink :

Only Shrink Larger Images ('>' flag) Another commonly used option is to restrict IM so that it will only shrink i开发者_开发百科mages to fit into the size given. Never enlarge. This is the '>' resize option.

Example:

convert dragon.gif    -resize 64x64\>  shrink_dragon.gif

The Only Shrink Flag ('>' flag) is a special character in Window batch scripts and you will need to escape that character, using '^>', or it will not work.

So as I understand this flag ('>') could only work either on windows ^> or unix /> . Is there any way to create command that will work both on windows and unix?

I use imagemagick with php, so I've got unix on production webserver, but windows on localhost.

Thank you.


If you are calling ImageMagick from a script, there is probably a built-in function for escaping shell arguments. In Python it's pipes.quote. In PHP it is escape_shell_arg();

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜