2 /* This file is part of
3 * =================================================
5 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich.
7 * Copyright 1995-2000 The LyX Team.
9 * ================================================= */
12 #pragma implementation
16 #include "ImageLoader.h"
17 #include "frontends/support/LyXImage.h"
19 #include "support/filetools.h"
21 ImageLoader::ImageLoader()
26 ImageLoader::~ImageLoader()
31 bool ImageLoader::isImageFormatOK(string const & /*filename*/) const
36 void ImageLoader::setImage(LyXImage * image)
43 void ImageLoader::freeImage()
49 ImageLoader::FormatList const
50 ImageLoader::loadableFormats() const
56 ImageLoader::loadImage(string const & filename)
58 // Make sure file exists and is readable.
59 if (! IsFileReadable(filename)) {
60 lyxerr << "No XPM file found." << endl;
64 // Verify that the file format is correct.
65 if (! isImageFormatOK(filename)) {
66 lyxerr << "File format incorrect." << endl;
67 return ImageFormatUnknown;
72 return runImageLoader(filename);