Page 1 of 1

percent excape access to globel varible fails

Posted: 2010-09-20T19:52:35-07:00
by anthony
This example use to work (create a label containing a color from a different image)

Code: Select all

convert rose:  -set option:mylabel '%[pixel:u[0].p{12,26}]'      label:'test %[mylabel]'   -delete 0  color.png
the -set sets a global 'artifact' (like -define but with percent escapes) that should be --- global.

However label: can not see that global artifact any more. I get a label of just "test " and without
the artifact string. The above used to work, but now does not.

But when I tried the equivelent...

Code: Select all

convert rose:  -define mylabel=rose      label:'test %[mylabel]'   -delete 0  color.png
It works!!!!

Using

Code: Select all

  convert rose:  -set option:mylabel '%[pixel:u[0].p{12,26}]'      label:'test %[mylabel]'  -verbose info:
shows that for the first case shows that a Artifact is created but only for the first image the 'global' artifact, but that 'global' setting is missing from the new label image.

And yet

Code: Select all

convert rose:  -define mylabel=rose      label:'test %[mylabel]'   -verbose info:
has the artifact in BOTH images!

In summery: -set option:key value should be the same as -define key=value but the above shows that it isn't!

Re: percent excape access to globel varible fails

Posted: 2010-09-21T05:40:48-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.6.4-5 Beta to fix it. Thanks.

Re: percent excape access to globel varible fails

Posted: 2010-09-22T19:28:05-07:00
by anthony
Yes it is working again. You can now even delete the first image completely before creating the label with the global 'artifact' setting, which is what I would have expected.

thanks.

I have reworked the -set and -define options in the command line options page, to try and may it clear about how it can modify known 'attribute', free-form per-image 'properties' and global 'artifacts'.

The IM Examples equivalent however is really really bad and incomplete, as it needs to cover more ground.