[英]imagemagick error when run from bash script on Mac OSX
I want to run the following script in bash 3.2.57(1): 我想在bash 3.2.57(1)中运行以下脚本:
#!/bin/bash
basename=abc
convert $basename.pdf $basename.png
I get the following error: 我收到以下错误:
dyld: Library not loaded: /ImageMagick-7.0.8/lib/libMagickCore-7.Q16HDRI.6.dylib
Referenced from: /Users/XXX/Applications/ImageMagick-7.0.8/bin/convert
Reason: image not found
./batch_convert.sh: line 22: 46228 Abort trap: 6 convert $basename.pdf $basename.png
When I run the same 2 commands (setting the variable and convert
), I get no error. 当我运行相同的2条命令(设置变量和
convert
)时,没有任何错误。
Why is this happening? 为什么会这样呢?
Using IM 7.0.8.59 Q16 Mac OSX Sierra, this works for me. 使用IM 7.0.8.59 Q16 Mac OSX Sierra,这对我有效。
create a pdf 创建一个PDF
magick logo: logo.pdf
create a script called test.sh 创建一个名为test.sh的脚本
#!/bin/bash
xxx="logo"
magick $xxx.pdf $xxx.png
run script by typing its name in a bash terminal 通过在bash终端中键入脚本名称来运行脚本
bash test.sh
Try that and report if that works. 试试看并报告是否可行。 I was working from my desktop.
我在桌面上工作。 So the script and pdf file were on my desktop.
因此脚本和pdf文件在我的桌面上。
Note that logo: (with the colon) is an ImageMagick internal image. 请注意徽标:(带有冒号)是ImageMagick的内部图像。 So it is available from anywhere.
因此它可以在任何地方使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.