Define var and use it later
Posted: 2009-08-13T14:33:02-07:00
May be this are basics, but i can not get it work:
i need to "remeber" image geometrics %w, %h to use them later on a different image in a convert string. Is this possible?
For example:
convert [....] \( -size 800x600 xc:none [....] -annotate +0+0 'Random Text' -trim \( -size '%[fx:w]x%[fx:h]' [....] \) -compose SrcIn -composite\) -compose Over -composite [....]
So instead of wrong? writing -size '%[fx:w]x%[fx:h]' there should be something that would have been defined previously (in a var?) and get the image size after -trim
And why, if i use -fx 'Xi=w; Yi=h;' it is not possible to use Xi or Yi somewhere later on? Or is it?
The convert string, which is generated dynamically is ok. If i manually write e.g. -size 200x40 it generates in general what is intended, but not exact, since exact width and height of the previous image are needed... Any ideas?
IM: latest
i need to "remeber" image geometrics %w, %h to use them later on a different image in a convert string. Is this possible?
For example:
convert [....] \( -size 800x600 xc:none [....] -annotate +0+0 'Random Text' -trim \( -size '%[fx:w]x%[fx:h]' [....] \) -compose SrcIn -composite\) -compose Over -composite [....]
So instead of wrong? writing -size '%[fx:w]x%[fx:h]' there should be something that would have been defined previously (in a var?) and get the image size after -trim
And why, if i use -fx 'Xi=w; Yi=h;' it is not possible to use Xi or Yi somewhere later on? Or is it?
The convert string, which is generated dynamically is ok. If i manually write e.g. -size 200x40 it generates in general what is intended, but not exact, since exact width and height of the previous image are needed... Any ideas?
IM: latest