{"action":"created","issue":{"url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/236","repository_url":"https://api.github.com/repos/ImageMagick/ImageMagick","labels_url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/236/labels{/name}","comments_url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/236/comments","events_url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/236/events","html_url":"https://github.com/ImageMagick/ImageMagick/issues/236","id":166060615,"node_id":"MDU6SXNzdWUxNjYwNjA2MTU=","number":236,"title":"API changes in Magick++7","user":{"login":"jeroen","id":216319,"node_id":"MDQ6VXNlcjIxNjMxOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/216319?v=4","gravatar_id":"","url":"https://api.github.com/users/jeroen","html_url":"https://github.com/jeroen","followers_url":"https://api.github.com/users/jeroen/followers","following_url":"https://api.github.com/users/jeroen/following{/other_user}","gists_url":"https://api.github.com/users/jeroen/gists{/gist_id}","starred_url":"https://api.github.com/users/jeroen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeroen/subscriptions","organizations_url":"https://api.github.com/users/jeroen/orgs","repos_url":"https://api.github.com/users/jeroen/repos","events_url":"https://api.github.com/users/jeroen/events{/privacy}","received_events_url":"https://api.github.com/users/jeroen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-18T10:07:59Z","updated_at":"2018-09-20T19:17:05Z","closed_at":"2017-09-03T16:51:47Z","author_association":"CONTRIBUTOR","body":"The following functions are documented and working on IMv6 however did not compile on IMv7.\n- `Magick::opacityImage`\n- `Magick::levelChannelImage`\n- `Magick::matteColorImage`\n- `Magick::matteImage`\n\nAlso:\n- `Magick::quantizeImages` changed signature\n\nAnd:\n- `penColorImage` is in the header but fails to link\n\nIs this expected? Where can I find a complete list of API changes in Magick++ 7?\n\n```\nimage-manipulate.cpp: In function 'XPtrImage magick_image_opacity(XPtrImage, std::size_t)':\nimage-manipulate.cpp:256:46: error: 'opacityImage' is not a member of 'Magick'\n   for_each ( output->begin(), output->end(), Magick::opacityImage(opacity));\n                                              ^\nimage-manipulate.cpp: In function 'XPtrImage magick_image_level(XPtrImage, double, double, double, int)':\nimage-manipulate.cpp:264:49: error: 'levelChannelImage' is not a member of 'Magick'\n      for_each ( output->begin(), output->end(), Magick::levelChannelImage((Magick::ChannelType) channel, black_point, white_point, mid_point));\n                                                 ^\nimage-manipulate.cpp: In function 'XPtrImage magick_image_matte(XPtrImage, bool, Rcpp::String)':\nimage-manipulate.cpp:275:48: error: 'matteColorImage' is not a member of 'Magick'\n     for_each ( output->begin(), output->end(), Magick::matteColorImage(color.get_cstring()));\n                                                ^\nimage-manipulate.cpp:276:46: error: 'matteImage' is not a member of 'Magick'\n   for_each ( output->begin(), output->end(), Magick::matteImage(matte));\n                                              ^\n```\n\nLog for `QuantizeImages`:\n\n```\n../windows/imagemagick-7.0.2.4/include/ImageMagick-7/Magick++/STL.h: In instantiation of 'void Magick::quantizeImages(InputIterator, InputIterator, bool) [with InputIterator = __gnu_cxx::__normal_iterator<Magick::Image*, std::vector<Magick::Image> >]':\nimage-stl.cpp:140:48:   required from here\n../windows/imagemagick-7.0.2.4/include/ImageMagick-7/Magick++/STL.h:2626:30: error: too few arguments to function 'MagickCore::MagickBooleanType MagickCore::QuantizeImages(const QuantizeInfo*, MagickCore::Image*, MagickCore::ExceptionInfo*)'\n              first_->image() );\n                              ^\nIn file included from ../windows/imagemagick-7.0.2.4/include/ImageMagick-7/MagickCore/MagickCore.h:139:0,\n                 from ../windows/imagemagick-7.0.2.4/include/ImageMagick-7/Magick++/Include.h:42,\n                 from ../windows/imagemagick-7.0.2.4/include/ImageMagick-7/Magick++.h:10,\n                 from magick_types.h:3,\n                 from image-stl.cpp:6:\n../windows/imagemagick-7.0.2.4/include/ImageMagick-7/MagickCore/quantize.h:61:3: note: declared here\n   QuantizeImages(const QuantizeInfo *,Image *,ExceptionInfo *),\n   ^\n```\n\nLog for `penColorImage`:\n\n```\nimage-manipulate.o:image-manipulate.cpp:(.text+0x475d): undefined reference to `Magick::penColorImage::penColorImage(Magick::Color const&)'\nimage-manipulate.o:image-manipulate.cpp:(.text+0x4798): undefined reference to `Magick::penColorImage::operator()(Magick::Image&) const'\ncollect2.exe: error: ld returned 1 exit status\n```\n"},"comment":{"url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/comments/423300882","html_url":"https://github.com/ImageMagick/ImageMagick/issues/236#issuecomment-423300882","issue_url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/236","id":423300882,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzMwMDg4Mg==","user":{"login":"ferdnyc","id":538020,"node_id":"MDQ6VXNlcjUzODAyMA==","avatar_url":"https://avatars0.githubusercontent.com/u/538020?v=4","gravatar_id":"","url":"https://api.github.com/users/ferdnyc","html_url":"https://github.com/ferdnyc","followers_url":"https://api.github.com/users/ferdnyc/followers","following_url":"https://api.github.com/users/ferdnyc/following{/other_user}","gists_url":"https://api.github.com/users/ferdnyc/gists{/gist_id}","starred_url":"https://api.github.com/users/ferdnyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ferdnyc/subscriptions","organizations_url":"https://api.github.com/users/ferdnyc/orgs","repos_url":"https://api.github.com/users/ferdnyc/repos","events_url":"https://api.github.com/users/ferdnyc/events{/privacy}","received_events_url":"https://api.github.com/users/ferdnyc/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T19:17:05Z","updated_at":"2018-09-20T19:17:05Z","author_association":"NONE","body":"Hi, as noted in the bug report I just referenced this from (OpenShot/libopenshot#162), the rename from `matte()` to `alpha()` in ImageMagick 7 broke compilation of libopenshot, since the code still uses `matte()`. \r\n\r\nRetaining IM6 compatibility is important to us, and since I guess there are no wrappers in either IM6 or IM7 to facilitate writing universally-compatible code, does IM7 provide `#define`s to conditionalize code based on the API version in use? \r\n\r\nAlso, the outcome of this was \"We will update the documentation.\", but it took me no small amount of time to track down the `matte()` deprecation because:\r\n1. It's never _directly_ documented as being deprecated **anywhere**, as far as I can tell.\r\n1. `matte()` simply disappears from [the API autodocs for the Image class](https://imagemagick.org/api/Magick++/classMagick_1_1Image.html), with no indication that `alpha()` should be used in its place. It's difficult to find information based on what's _not_ there, so that's of very little use to anyone trying to update their IM6 code to IM7.\r\n1. The [Porting to ImageMagick version 7](http://www.imagemagick.org/script/porting.php) document _nowhere_ mentions the `matte()` attribute rename.\r\n   1. It lists the `DrawMatte()` -> `DrawAlpha()` rename\r\n   1. There's a note that \"The `matte` primitive is now `alpha`\" for the `-draw` command line option\r\n\r\n   But the removal/rename of `matte()` as a `Magick::Image` attribute method is never once addressed in that entire document.\r\n1. [Porting to ImageMagick version 7](http://www.imagemagick.org/script/porting.php) in fact claims, right at the top:\r\n   > The Magick++ and PerlMagick API's have not changed and matches that of the ImageMagick version 6.\r\n1. The _non_-autodoc API documentation still lists `matte()` as a valid attribute. It appears on both of the following pages:\r\n   1. http://www.imagemagick.org/api/Image++.php\r\n   1. http://www.imagemagick.org/Magick++/Image++.html\r\n\r\nPlease, at _least_ clearly and explicitly document the **deprecation** of `matte()` (in _all_ currently-available documentation where it's mentioned), and provide instruction that `alpha()` is to be used in its place.\r\n\r\nIf you really wanted to help your API users, adding `alpha()` as a wrapper/alias for `matte()` in future releases of IM6 (so that code can be ported to IM7 without losing compatibility with **all** versions of IM6) would be welcome. (Actually, doing that long **before** `matte()` was removed in IM7 would've been even more welcome.)"}}
{"actor":{"display_login":"ferdnyc"}}