#include "GraphicsImage.h"
#include "debug.h"
+#include "format.h"
#include "support/filetools.h"
#include "support/FileMonitor.h"
using support::IsFileReadable;
using support::MakeDisplayPath;
using support::OnlyFilename;
-using support::getFormatFromContents;
using support::tempName;
using support::unlink;
using support::unzipFile;
namespace lyx {
namespace graphics {
-struct CacheItem::Impl : public boost::signals::trackable {
+class CacheItem::Impl : public boost::signals::trackable {
+public:
///
Impl(string const & file);
<< "\n\twith displayed filename: " << displayed_filename
<< endl;
- string from = getFormatFromContents(filename);
+ string const from = formats.getFormatFromFile(filename);
+ if (from.empty()) {
+ setStatus(ErrorConverting);
+ lyxerr[Debug::GRAPHICS]
+ << "\tCould not determine file format." << endl;
+ return;
+ }
lyxerr[Debug::GRAPHICS]
<< "\n\tThe file contains " << from << " format data." << endl;
string const to = findTargetFormat(from);