我有一个zsh脚本。有一个函数...
imgPrep()
{
local inFilePath=$1
local outFilePath=$2
local cropHeight=$3
local resize=$4
shift; shift; shift; shift
local options=$@
convert ${inFilePath} -crop 0x${cropHeight}+0+0 +repage -resize ${resize}% ${options} ${outFilePath}
}
我这样调用这个函数:
IMoptions="-despeckle -unsharp 0x3+1+0"
imgPrep ${inputImgFilePath} ${headerImgFilePath} ${headerHeight} ${scale} ${IMoptions}
convert命令失败,可能是因为单引号不应该出现。
convert somefile.jpg -crop 0x60+0+0 +repage -resize 410% '-despeckle -unsharp 0x3+1+0' output.tif
convert: unrecognized option `-despeckle -unsharp 0x3+1+0' @ error/convert.c/ConvertImageCommand/1437
请问我该怎么修?
1条答案
按热度按时间llmtgqce1#
我通过使用阵列解决了此问题
...
谢谢丹尼尔·凯利提供了正确答案,幸运的是,我在它被删除之前抓住了它,这真是太遗憾了。