Page 1 of 1

defineValue not working since 6.8.5

Posted: 2013-04-25T23:20:55-07:00
by zhcn381
hi, magick

I noticed that new version IM use GetImageArtifact() instead of GetImageOption() in some place(linke codes/webp.c). But defineValue() in Magick++ still use SetImageOption(). So how to set image option now?

Re: defineValue not working since 6.8.5

Posted: 2013-04-26T04:14:59-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.5-2 Beta available by sometime tomorrow. Thanks.

Re: defineValue not working since 6.8.5

Posted: 2013-04-30T23:51:47-07:00
by anthony
In imagemagick Artifacts and Options are essentually the same thing.

Options are stored in Image_info which is a global wrapper around the Image list, Typically as part of a 'Wand'.
Artifacts are stored in each image structure.

most Image processing options only see an image, and not an image_info structure. as such it is the artifact that they lookup and generally it is the artifact that is important.

NOTE PerlMagick has no image_info options

IMv6 CLI will copy all options to artifacts before practially every operation.
As such when a operator does a lookup of an artifact and will see a copy of the relevant option.

IMv7 CLI adds a link from each image pointing back to the containing image_info structure
when it does an artifact lookup, it trys the per image artifact, and failign a match looks at that image_info link, and trys to find a relevent global option.


This works better as 1/ options are not continuously copied, and 2/ you can have a global option and a per-image override of that option. yes it is a different coding philosophy.


If the defining of an option fails. Then either IMv6 did not call the SyncImagesSettings() function, OR in IMv7 the optional link from the image structure back to the holding image_info structure was not set.


Now Magick++ and other API's also need to think about how they will set the artifacts according to the current set of options. They always did need to do something here, but now they have two choices in how they can do this.

Just remember more operators only understand artifacts. It is the GetImageArtifact() function that will follow the image_info link, if the link is present.

The exception to 'artifact use' is in coders which has a info_info and needs to use the information to create an image. When writing it probably has direct access to both.