From 3e538355e2740721ca8b0c20faf72b2e6d607ec7 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 9 Jun 2021 08:34:58 +0000 Subject: [PATCH] highgui: force loading of imgcodecs module - required for plugins on Linux (they use imwrite, but there is no link dependency) --- modules/highgui/src/plugin_wrapper.impl.hpp | 4 ++++ 1 file changed, 4 insertions(+) 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);