+ static vector<string> fmts;
+
+ if (!fmts.empty())
+ return fmts;
+
+ for (string const & native_extension : frontend::loadableImageFormats()) {
+ for (Format const & format : theFormats()) {
+ if (format.extension() == native_extension) {
+ fmts.push_back(format.name());
+ break;
+ }
+ }
+ }
+
+ if (lyxerr.debugging()) {
+ LYXERR(Debug::GRAPHICS, "LyX recognises the following image formats:");
+ for (string const & format : fmts) {
+ LYXERR(Debug::GRAPHICS, format << ',');
+ }
+ }
+
+ return fmts;