From: Alexander Alekhin Date: Wed, 9 Jun 2021 08:34:58 +0000 (+0000) Subject: highgui: force loading of imgcodecs module X-Git-Tag: submit/tizen/20220120.021815~1^2~33^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e538355e2740721ca8b0c20faf72b2e6d607ec7;p=platform%2Fupstream%2Fopencv.git highgui: force loading of imgcodecs module - required for plugins on Linux (they use imwrite, but there is no link dependency) --- diff --git a/modules/highgui/src/plugin_wrapper.impl.hpp b/modules/highgui/src/plugin_wrapper.impl.hpp index 3fa2cfa11a..97aea69098 100644 --- a/modules/highgui/src/plugin_wrapper.impl.hpp +++ b/modules/highgui/src/plugin_wrapper.impl.hpp @@ -232,8 +232,12 @@ std::vector getPluginCandidates(const std::string& baseName) return results; } +// NB: require loading of imgcodecs module +static void* g_imwrite = (void*)imwrite; + void PluginUIBackendFactory::loadPlugin() { + CV_Assert(g_imwrite); for (const FileSystemPath_t& plugin : getPluginCandidates(baseName_)) { auto lib = std::make_shared(plugin);