Page 1 of 1

How to put filename onto the image with "mogrify"?

Posted: 2010-06-10T23:26:34-07:00
by grisha
Hi.

I've 182 png images that are in a certain order. I've renamed the filenames according to it. So it goes from 000.png.....to 181.png.

The images will be printed and I would like to include this number on the images.
I've tried the following command:


mogrify -gravity southwest -font Times-New-Roman-bold -pointsize 12 -fill green -draw "text 5,5 '%f'" *.png

The program puts %f on the images, but not the actual filename.

I've tried different operands, like $f, %filename, $filename, filename, but with the same result.
I've also tried it on different OSs, like Linux (ubuntu 10.04, ver 6.5.7.8) and windows XP ImageMagick-6.6.2-4-Q16-windows-dll, and Win7 ImageMagick-6.6.2-4-Q16-windows-x64-static.

Anyone could help?
I would really appreciate a help.



Thx

Re: How to put filename onto the image with "mogrify"?

Posted: 2010-06-11T08:26:43-07:00
by snibgo
"-draw" doesn't take expand escapes.

Alternatives include using "-annotate", which does expand escapes, or using environment variables.