Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to imagemagick7 #956

Open
dmacks opened this issue Apr 18, 2021 · 1 comment
Open

Update to imagemagick7 #956

dmacks opened this issue Apr 18, 2021 · 1 comment
Assignees

Comments

@dmacks
Copy link

dmacks commented Apr 18, 2021

virtuoso-7.2.5.1 uses some magickwand APIs that changed from magick6 to magick7. First, there is already confusion about the header filename: configure.ac checks for wand/magick-wand.h but binsrc/samples/image_magick/im.c was changed to use wand/MagickWand.h in 0179c47. I'm not sure why ./configure needs to check for the specific header, given it's already used pkg-config to check for the library itself...seems like just one more thing to have to keep updated manually?

For magick7, it's now called MagickWand/MagickWand.h. Making the change here and and in configure leads to three types of compile-time failure:

im.c:517:71: error: too many arguments to function call, expected 4, have 5
      MagickResizeImage (env.ime_magick_wand, h_size, v_size, filter, blur);
      ~~~~~~~~~~~~~~~~~                                               ^~~~
[...]
im.c:597:70: error: too many arguments to function call, expected 4, have 5
      MagickResampleImage (env.ime_magick_wand,v_size, h_size,filter,blur);
      ~~~~~~~~~~~~~~~~~~~                                            ^~~~
[...]
im.c:839:161: error: too few arguments to function call, expected 6, have 5
  ...MagickCompositeImage (env.ime_target_magick_wand, env.ime_magick_wand, OverCompositeOp, (image_ctr & 1) * 128, (image_ctr & 2) * 64))
     ~~~~~~~~~~~~~~~~~~~~                                                                                                               ^

as a result of API changes. MagickResizeImage() and MagickResampleImage() no longer take a blur parameter. And MagickCompositeImage() has a new clip_to_self boolean parameter after the CompositeOperator (see for example leafo/magick/issues/57). Removing the blur parameter and inserting 1.0 for the clip flag gets im.so to compile on my OS X 10.13 box (all non-Apple dependencies supplied by fink). I don't know if that is the right solution though, since the blur values seem to come from external to the code here...not sure if there is an alternate way to implement whatever feature is desired for it.

@pkleef
Copy link
Collaborator

pkleef commented Apr 18, 2021

I do not think it is as easy as changing a few calls in the code, but we would have to do a full investigation and evaluate all the changes between the ImageMagick 6 and 7 APIs.

As the im.so plugin is an optional plugin for Virtuoso, and is mainly used by the ODS applications, this is currently not a high priority. Many current Linux distributions still ship with ImageMagick 6, and although Apple does not ship this library, packages are available via homebrew, fink, or macports.

As you mention you are using fink, i would advice you to use the ImageMagick 6 libraries which are as I can see available as well:

https://pdb.finkproject.org/pdb/package.php/imagemagick6.9.q16-common

Alternatively you can configure VOS with the --disable-imagemagick option to disable building this plugin. Note this does NOT affect the main functionality of the Virtuoso database.

@pkleef pkleef self-assigned this Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants