使用imagemagick处理文件名中的冒号

时间:2017-08-25 09:12:12

标签: imagemagick

当我尝试使用:

从pdf文件制作缩略图时
convert -density 200 -quality 100 path/to/some:file.pdf[0] thumb.jpeg

我收到此错误:

convert: unable to open image `file.pdf': No such file or directory @ error/blob.c/OpenBlob/2712.
convert: no images defined `test.jpg' @ error/convert.c/ConvertImageCommand/3210.

我认为文件名中的冒号是问题所在。我尝试转义它,并将文件名用双引号括起来,但没有运气......是否可以将此命令用于此类文件名?

1 个答案:

答案 0 :(得分:2)

要处理文件名中的冒号,请在其前面加冒号:

convert -density 200 -quality 100 :path/to/some:file.pdf[0] thumb.jpeg