【问题标题】:how to insert text in images sequentially in a directory如何在目录中顺序插入图像中的文本
【发布时间】:2018-04-22 18:57:19
【问题描述】:

我尝试了以下方法:

n=1
for index in image*.png; 
do convert $index -fill white  -undercolor '#00000080'  -gravity South -pointsize 44 -annotate +0+550 “image`echo $n`”;
((n++)); 
done

这会导致错误:

转换:`“image1”' @error/convert.c/ConvertImageCommand/3272。

以此类推,直到目录中所有图像文件的末尾。

基本上我试图在图像中插入文本作为文件名。

【问题讨论】:

  • 你有错误的引号:“”。使用直引号:""

标签: bash imagemagick imagemagick-convert


【解决方案1】:

“imageecho $n”周围的普通双引号已替换为打开/关闭双引号 (*)。另外,echo 是不必要的,试试"image$n.png"

(*) 可能是一个不打算编辑代码的编辑器的行为,也许是用写字板编辑?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-02-03
    • 2020-02-28
    • 2019-01-10
    • 2012-09-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多