as diu
as diu

Reputation: 1090

how to insert text in images sequentially in a directory

I have tried the following:

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

This results in an error:

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

and so on till the end of all image files in the directory.

Basically I'm trying to insert text as the filename in the image.

Upvotes: 0

Views: 93

Answers (1)

xenoid
xenoid

Reputation: 8904

Your plain double quotes around “imageecho $n” have been replaced by opening/closing double quotes(*). Also, the echo is unnecessary, try "image$n.png"

(*) possibly the deed of an editor not meant to edit code, editing with Wordpad perhaps?

Upvotes: 2

Related Questions