Page 4 of 4
Re: Uniting different commands in a single one
Posted: 2010-12-10T19:50:02-07:00
by javismiles
is the example in "I have uploaded this example in IM Examples, Text Handling, Form Filling
http://www.imagemagick.org/Usage/text/#form_filling"
cant find it so far
thank you
Re: Uniting different commands in a single one
Posted: 2010-12-10T19:56:02-07:00
by javismiles
looking at the code below
the part that i have problems to pass to php is just this one
"miff:-
done |
convert "
is 'done' the end of the loop? is the pipe | the link between the loop and the next convert statement? and if so, how can we execute that from an scripting language like php?
i understand the miff format, and the function of the pipe, it seems you are looping creating each text and putting them in memory, miff, thats great,
and then you flatten them all and onto a large background png, i just dont clearly see, do you first loop creating each text and then when - done - , you pipe it all to the final convert that flattens?
or am i missing something else?
and how do we do that pipe, i mean, is this a single command? cannot be if there is a loop, if there is a loop it cannot be a single command in php
cat text_data.txt |
while read width gravity color pointsize x y text
do
convert -size ${width}x -gravity $gravity -fill $color -background wheat \
-pointsize $pointsize -page +${x}+${y} label:"${text}" miff:-
done |
convert -size 200x100 xc: - -flatten text_layered.png
Re: Uniting different commands in a single one
Posted: 2010-12-10T19:58:25-07:00
by anthony
It is just a repeat of the initial while loop pipeline. It will appear soon.
However you can not simply mix PHP and shell. PHP has no real concept of pipelines, shell does.
The example opened a command to which it can then print the 'text data' into that command for the shell 'read' command to read.
I think you will need to look at more PHP to Shell interaction examples somewhere. If you find a good guide, please let me know.
Re: Uniting different commands in a single one
Posted: 2010-12-10T20:03:29-07:00
by javismiles
i see, mmm
well, then it seems to me that the pipes cannot be translated into php, and probably each shell pipe means a new command in php i guess
if i find anything about this for sure i will let u know, i hope i find something around
the pity is that if there was a justification tag , all of this would be so easy,
the examples we posted in the morning worked all perfect, in 1 single command, except that imagemagick was confusing the local justification of
the texts with the global gravity relative to the background, if it wasnt for that it would be so easy,
Re: Uniting different commands in a single one
Posted: 2010-12-10T20:33:42-07:00
by anthony
one shell command, containing the while loop and pipeline, with a data feed.
Re: Uniting different commands in a single one
Posted: 2010-12-11T00:38:06-07:00
by javismiles
yeah thats on the shell, the question is how to replicate that with php code and still one single command
we know how to do it also in php with one single command, but it breaks because imagemagick confuses local justification with the global one,
anyways, they have to make justification and gravity independent of each other, honestly thats quite obviously necessary for quite a few uses
Re: Uniting different commands in a single one
Posted: 2010-12-11T01:25:15-07:00
by javismiles
which reminds me,
this issue of justification and gravity not being separated, does this happen only in imagemagick? or is this generic all around?
thank you again for all your help and tips and all
and thank you to imagemagick, its so very useful in so many ways
Re: Uniting different commands in a single one
Posted: 2010-12-12T04:57:06-07:00
by anthony
Graphics Magick was a fork of IM from IM v5 it is missing a LOT of the stuff that has been added to IM. As such I would not be surprised if it is missing from it.