diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index b3efd78a09..1513636867 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -227,14 +227,25 @@ vector loadableImageFormats() if (qt_formats.empty()) LYXERR(Debug::GRAPHICS, "\nQt4 Problem: No Format available!"); + bool jpeg_found = false; + bool jpg_found = false; for (QList::const_iterator it = qt_formats.begin(); it != qt_formats.end(); ++it) { LYXERR(Debug::GRAPHICS, (const char *) *it << ", "); string ext = ascii_lowercase((const char *) *it); // special case - if (ext == "jpeg") + if (ext == "jpeg") { + jpeg_found = true; + if (jpg_found) + continue; ext = "jpg"; + } + else if (ext == "jpg") { + jpg_found = true; + if (jpeg_found) + continue; + } fmts.push_back(ext); }