-/// Return the list of loadable formats.
-Image::FormatList GuiImage::loadableFormats()
-{
- static FormatList fmts;
-
- if (!fmts.empty())
- return fmts;
-
- // The formats recognised by LyX
- Formats::const_iterator begin = formats.begin();
- Formats::const_iterator end = formats.end();
-
-
-// LYXERR(Debug::GRAPHICS)
-// << "D:/msys/home/yns/src/lyx-devel/lib/images/banner.png mis of format: "
-// << fromqstr(Pic.pictureFormat("D:/msys/home/yns/src/lyx-devel/lib/images/banner.png"))
-// << endl;
-// if (Pic.pictureFormat("D:/msys/home/yns/src/lyx-devel/lib/images/banner.png"))
-// LYXERR(Debug::GRAPHICS)
-// << "pictureFormat not returned NULL\n" << endl;
-// << "Supported formats are: " << Pic.inputFormats() << endl;
-
- QList<QByteArray> qt_formats = QImageReader::supportedImageFormats ();
-
- LYXERR(Debug::GRAPHICS)
- << "\nThe image loader can load the following directly:\n";
-
- if (qt_formats.empty())
- LYXERR(Debug::GRAPHICS)
- << "\nQt4 Problem: No Format available!" << endl;
-
- for (QList<QByteArray>::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")
- ext = "jpg";
-
- Formats::const_iterator fit =
- find_if(begin, end,
- bind(equal_to<string>(),
- bind(&Format::extension, _1),
- ext));
- if (fit != end)
- fmts.push_back(fit->name());
- }
-
- if (lyxerr.debugging()) {
- LYXERR(Debug::GRAPHICS)
- << "\nOf these, LyX recognises the following formats:\n";
-
- FormatList::const_iterator fbegin = fmts.begin();
- FormatList::const_iterator fend = fmts.end();
- for (FormatList::const_iterator fit = fbegin; fit != fend; ++fit) {
- if (fit != fbegin)
- LYXERR(Debug::GRAPHICS) << ", ";
- LYXERR(Debug::GRAPHICS) << *fit;
- }
- LYXERR(Debug::GRAPHICS) << '\n' << endl;
- }
-
- return fmts;
-}