percent excape access to globel varible fails

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

percent excape access to globel varible fails

Post 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!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: percent excape access to globel varible fails

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.6.4-5 Beta to fix it. Thanks.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: percent excape access to globel varible fails

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply