c-koi/gmic-qt

gimp3 host build fails: error: ‘gimp_image_get_active_layer’ was not declared in this scope

slackernetuk opened this issue · 7 comments

OS: Slackware -current
gmic-qt: master

[ 90%] Building CXX object CMakeFiles/gmic_gimp_qt.dir/src/Widgets/ZoomLevelSelector.cpp.o
[ 91%] Building CXX object CMakeFiles/gmic_gimp_qt.dir/src/Widgets/SearchFieldWidget.cpp.o
[ 92%] Building CXX object CMakeFiles/gmic_gimp_qt.dir/src/Widgets/LanguageSelectionWidget.cpp.o
[ 93%] Building CXX object CMakeFiles/gmic_gimp_qt.dir/src/Widgets/ProgressInfoWindow.cpp.o
[ 94%] Building CXX object CMakeFiles/gmic_gimp_qt.dir/src/Widgets/VisibleTagSelector.cpp.o
[ 95%] Building CXX object CMakeFiles/gmic_gimp_qt.dir/src/Host/Gimp/host_gimp.cpp.o
/tmp/snuk/gmic/gmic-qt/src/Host/Gimp/host_gimp.cpp: In function ‘void GmicQtHost::getLayersExtent(int*, int*, GmicQt::InputMode)’:
/tmp/snuk/gmic/gmic-qt/src/Host/Gimp/host_gimp.cpp:495:33: error: ‘gimp_image_get_active_layer’ was not declared in this scope; did you mean ‘gimp_image_remove_layer’?
  495 |   _GimpLayerPtr activeLayerID = gimp_image_get_active_layer(gmic_qt_gimp_image_id);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 gimp_image_remove_layer
/tmp/snuk/gmic/gmic-qt/src/Host/Gimp/host_gimp.cpp: In function ‘void GmicQtHost::getCroppedImages(cimg_library::CImgList<float>&, cimg_library::CImgList<char>&, double, double, double, double, GmicQt::InputMode)’:
/tmp/snuk/gmic/gmic-qt/src/Host/Gimp/host_gimp.cpp:563:35: error: ‘gimp_image_get_active_layer’ was not declared in this scope; did you mean ‘gimp_image_remove_layer’?
  563 |   _GimpLayerPtr active_layer_id = gimp_image_get_active_layer(gmic_qt_gimp_image_id);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                   gimp_image_remove_layer
/tmp/snuk/gmic/gmic-qt/src/Host/Gimp/host_gimp.cpp: In function ‘void GmicQtHost::outputImages(cimg_library::CImgList<float>&, const cimg_library::CImgList<char>&, GmicQt::OutputMode)’:
/tmp/snuk/gmic/gmic-qt/src/Host/Gimp/host_gimp.cpp:892:37: error: ‘gimp_image_get_active_layer’ was not declared in this scope; did you mean ‘gimp_image_remove_layer’?
  892 |     _GimpLayerPtr active_layer_id = gimp_image_get_active_layer(gmic_qt_gimp_image_id);
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                     gimp_image_remove_layer
/tmp/snuk/gmic/gmic-qt/src/Host/Gimp/host_gimp.cpp:963:11: error: ‘gimp_image_set_active_layer’ was not declared in this scope; did you mean ‘gimp_image_unset_active_channel’?
  963 |           gimp_image_set_active_layer(gmic_qt_gimp_image_id, active_layer_id);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |           gimp_image_unset_active_channel
/tmp/snuk/gmic/gmic-qt/src/Host/Gimp/host_gimp.cpp:965:11: error: ‘gimp_image_set_active_layer’ was not declared in this scope; did you mean ‘gimp_image_unset_active_channel’?
  965 |           gimp_image_set_active_layer(gmic_qt_gimp_image_id, top_layer_id);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |           gimp_image_unset_active_channel
/tmp/snuk/gmic/gmic-qt/src/Host/Gimp/host_gimp.cpp:971:37: error: ‘gimp_image_get_active_layer’ was not declared in this scope; did you mean ‘gimp_image_remove_layer’?
  971 |     _GimpLayerPtr active_layer_id = gimp_image_get_active_layer(gmic_qt_gimp_image_id);
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                     gimp_image_remove_layer
gmake[2]: *** [CMakeFiles/gmic_gimp_qt.dir/build.make:1230: CMakeFiles/gmic_gimp_qt.dir/src/Host/Gimp/host_gimp.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/gmic_gimp_qt.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

GIMP now supports selecting multiple layers so the API was deprecated as described in #114 (comment) and #104 (comment) and GIMP 2.99.12 removed the deprecated functions altogether.

The plug-in will need to be updated to use gimp_image_list_selected_layers() instead of gimp_image_get_active_layer().

Looking forward to fixing this bug.

Coming late to this party - may I humbly suggest that information about this API deprecation issue that affects the gmic_gimp_qt plugin be put on the primary GMIC QT plugin download page? Please. I just spent TWO DAYS trying to figure out why the plugin worked in GIMP 2.99.8 but did not work in 2.99.12 before I found this issue here that clearly and unambiguously says why it does not work. Yes, I know 2.99.12 is not a stable release, but 3.00 will be and this issue will remain in all future non 2.10.x versions of GIMP until the QT plugin is updated to use the new API (however far into the future that update may be).

@gstalnaker : GIMP 2.99.x is known to be a development version, so it is expected that features can be broken or changing at a fast pace (that is indeed the case for the plug-in API of future GIMP 3.0).
So to say, we do not suggest using the development version of GIMP if you require sth stable over time, particularly if you use third-party plug-ins (I doubt that many existing 3rd-party plug-ins continue to work with current dev version of GIMP).

When GIMP 3.0 will be out, as a stable version, we'll probably try to make the G'MIC code compatible with the GIMP 3.0 plug-in API, but until then, we won't try to follow the API changes in GIMP 2.99, as things could break and break again until the stable release.
If someone wants to do this job for G'MIC, and has the time to so do, then of course he's welcome.