openlink / virtuoso-opensource

Virtuoso is a high-performance and scalable Multi-Model RDBMS, Data Integration Middleware, Linked Data Deployment, and HTTP Application Server Platform
https://vos.openlinksw.com
Other
868 stars 210 forks source link

Update to imagemagick7 #956

Open dmacks opened 3 years ago

dmacks commented 3 years ago

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 0179c479315f222172c3e3fde5fa5c8a47af5b4e. 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 commented 3 years ago

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.