开发者

"Unable to open image" error when using ImageMagick's Filename References

开发者 https://www.devze.com 2023-02-03 11:33 出处:网络
I\'m using ImageMagick to do some image processing from the commandline, and would like to operate on a list of files as specified in foo.txt. From the instructions here: http://www.imagemagick.org/sc

I'm using ImageMagick to do some image processing from the commandline, and would like to operate on a list of files as specified in foo.txt. From the instructions here: http://www.imagemagick.org/script/command-line-processing.php I see that I can use Filename References from a file prefixed with @. When I run something like:

montage @foo.txt output.jpg

everything works as expected, as long as foo.txt is in the current directory. However, when I try to access bar.txt i开发者_如何转开发n a different directory by running:

montage /some_directory/@bar.txt output2.jpg

I get:

montage: unable to open image /some_directory/@bar.txt: No such file or directory @ blob.c/OpenBlob/2480.

I believe the issue is my syntax, but I'm not sure what to change it to. Any help would be appreciated.


Quite an old entry but it seems relatively obvious that you need to put the @ before the full path:

montage @/some_directory/bar.txt output2.jpg


As of ImageMagick 6.5.4-7 2014-02-10, paths are not supported with @ syntax. The @ file must be in the current directory and identified by name only.


I haven't tried directing IM to pull the list of files from a file, but I do specify multiple files on the command line like this:

gm -sOutputFile=dest.ext -f file1.ppm file2.ppm file3.ppm

Can you pull the contents of that file into a variable, and then let the shell expand that variable?

0

精彩评论

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