Page 1 of 1

how to read file to caption: *without* modifying @ policy.xml

Posted: 2017-02-01T15:04:53-07:00
by fredzannarbor
Hi,

I need to create a caption using text from a file but *without* modifying the policy.xml. What is a workaround?

Code: Select all

convert -background white -fill black -gravity west -size 2000x2000 -font "Utopia" -pointsize "64" caption:@sumall.txt sumall3.png
produces:

Code: Select all

convert: not authorized `@/tmp/pagekicker/028c5142-e8b2-11e6-ace4-02607828b875/sumall.txt' 

Re: how to read file to caption: *without* modifying @ policy.xml

Posted: 2017-02-01T15:33:27-07:00
by snibgo
As a workaround, build the command from the contents of the file. I would do this via an environment variable in Windows. In bash, you can embed a "cat" command within the convert.

Re: how to read file to caption: *without* modifying @ policy.xml

Posted: 2017-02-01T16:25:33-07:00
by fmw42
In unix, do

Code: Select all

data=`cat file.txt`
convert -size 100x100 -font arial -pointsize 18 label:"$data" result.png
Or this seems to work for me

Code: Select all

cat test.txt | convert -size 100x100 -font arial -pointsize 18 label:@- result.png
Same should work for caption: