How to use stdin with caption in ImageMagick

前端 未结 2 1170
悲哀的现实
悲哀的现实 2021-01-14 13:18

My understanding from reading the ImageMagick documentation regarding text, is that the @- notation reads the contents of standard input.

As such, this

2条回答
  •  生来不讨喜
    2021-01-14 14:06

    No need to build from source. Just replace @- with "`tee`" :

    printf "Hello\nWorld" | 
    convert \
      -size 1280x100 \
      -background '#0000FF10' \
      -density 90 \
      -gravity Center \
      -fill black \
      -font Helvetica \
      caption:"`tee`" \
      test.png
    

    `tee` will execute first and 'process' stdin before completing the convert command.

提交回复
热议问题