defineValue not working since 6.8.5

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
zhcn381
Posts: 17
Joined: 2012-07-05T02:34:18-07:00
Authentication code: 13

defineValue not working since 6.8.5

Post 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?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: defineValue not working since 6.8.5

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: defineValue not working since 6.8.5

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