Michael F. Stemper
2022-06-13 19:28:31 UTC
I'm trying to time-stamp image files as they're downloaded. The
following works fine:
$ convert -pointsize 20 -fill black -draw 'text 10,20 "06/13 14:13"' RadarMap.png Stamped.png
However, hard-coding the time stamp would make it worthless. What
I really want to use is the output of:
$ date +"%m/%d %H:%M"
But no matter how I try to incorporate that into the command, I
get errors.
For instance,
$ convert -pointsize 20 -fill black -draw 'text 10,20 $(date +"%m/%d %H:%M")' RadarMap.png Stamped.png
convert: non-conforming drawing primitive definition `(' @ error/draw.c/DrawImage/3190.
or:
$ convert -pointsize 20 -fill black -draw "text 10,20 $(date +"%m/%d %H:%M")" RadarMap.png Stamped.png
convert: non-conforming drawing primitive definition `text' @ error/draw.c/DrawImage/3190.
I've even tried two steps, initializing a variable and using it:
$ ts=$(date +"%m/%d %H:%M")
$ echo $ts
06/13 14:24
$ convert -pointsize 20 -fill black -draw "text 10,20 $ts" RadarMap.png Stamped.png
convert: non-conforming drawing primitive definition `text' @ error/draw.c/DrawImage/3190.
$ convert -pointsize 20 -fill black -draw 'text 10,20 $ts' RadarMap.png Stamped.png
convert: non-conforming drawing primitive definition `ts' @ error/draw.c/DrawImage/3190.
I'm sure that what I need to do to get a dynamic argument into
convert will be obvious to everybody except me. What am I missing?
Thanks,
following works fine:
$ convert -pointsize 20 -fill black -draw 'text 10,20 "06/13 14:13"' RadarMap.png Stamped.png
However, hard-coding the time stamp would make it worthless. What
I really want to use is the output of:
$ date +"%m/%d %H:%M"
But no matter how I try to incorporate that into the command, I
get errors.
For instance,
$ convert -pointsize 20 -fill black -draw 'text 10,20 $(date +"%m/%d %H:%M")' RadarMap.png Stamped.png
convert: non-conforming drawing primitive definition `(' @ error/draw.c/DrawImage/3190.
or:
$ convert -pointsize 20 -fill black -draw "text 10,20 $(date +"%m/%d %H:%M")" RadarMap.png Stamped.png
convert: non-conforming drawing primitive definition `text' @ error/draw.c/DrawImage/3190.
I've even tried two steps, initializing a variable and using it:
$ ts=$(date +"%m/%d %H:%M")
$ echo $ts
06/13 14:24
$ convert -pointsize 20 -fill black -draw "text 10,20 $ts" RadarMap.png Stamped.png
convert: non-conforming drawing primitive definition `text' @ error/draw.c/DrawImage/3190.
$ convert -pointsize 20 -fill black -draw 'text 10,20 $ts' RadarMap.png Stamped.png
convert: non-conforming drawing primitive definition `ts' @ error/draw.c/DrawImage/3190.
I'm sure that what I need to do to get a dynamic argument into
convert will be obvious to everybody except me. What am I missing?
Thanks,
--
Michael F. Stemper
Deuteronomy 24:17
Michael F. Stemper
Deuteronomy 24:17