+2006-01-11 Georg Baum <Georg.Baum@post.rwth-aachen.de>
+
+ * converter.C (convert): handle unknown formats
+
2006-01-19 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* cursor.C (goUpDown): comment out some debug messages.
* rowpainter.C (paintPar): always repaint the row with the
cursor in it
-2006-01-01 Lars Gullik Bjønnes <larsbj@gullik.net>
+2006-01-01 Lars Gullik Bjønnes <larsbj@gullik.net>
* MenuBackend.h:
* bufferlist.h:
if (try_default) {
// if no special converter defined, then we take the
// default one from ImageMagic.
- string const from_ext = formats.extension(from_format);
+ string const from_ext = from_format.empty() ?
+ GetExtension(from_file) :
+ formats.extension(from_format);
string const command =
"sh " +
QuoteName(LibFileSearch("scripts", "convertDefault.sh")) +
+2006-01-11 Georg Baum <Georg.Baum@post.rwth-aachen.de>
+
+ * GraphicsCacheItem.C (convertToDisplayFormat): handle unknown
+ formats
+ * GraphicsConverter.C (Impl, build_script): ditto
+
2005-11-02 Angus Leeming <leeming@lyx.org>
* GraphicsCacheItem.C: trivial fix to a MSVS warning.
typedef lyx::graphics::Image::FormatList FormatList;
FormatList const formats = lyx::graphics::Image::loadableFormats();
- // There must be a format to load from.
- BOOST_ASSERT(!formats.empty());
+ // Use the standard converter if we don't know the format to load
+ // from.
+ if (!formats.empty())
+ return string("ppm");
// First ascertain if we can load directly with no conversion
FormatList::const_iterator it = formats.begin();
setStatus(ErrorConverting);
lyxerr[Debug::GRAPHICS]
<< "\tCould not determine file format." << endl;
- return;
}
lyxerr[Debug::GRAPHICS]
<< "\n\tThe file contains " << from << " format data." << endl;
script_command_ =
"sh " +
QuoteName(LibFileSearch("scripts", "convertDefault.sh")) +
- ' ' +
- QuoteName(from_format + ':' + from_file) +
+ ' ' +
+ QuoteName((from_format.empty() ? "" : from_format + ':') + from_file) +
' ' +
QuoteName(to_format + ':' + to_file_);
lyxerr[Debug::GRAPHICS] << "build_script ... ";
typedef Converters::EdgePath EdgePath;
+ if (from_format.empty())
+ return false;
+
// we do not use ChangeExtension because this is a basename
// which may nevertheless contain a '.'
string const to_file = to_file_base + '.'
+2006-01-11 Georg Baum <Georg.Baum@post.rwth-aachen.de>
+
+ * insetgraphics.C (findTargetFormat): document
+ * insetgraphics.C (prepareFile): handle unknown formats
+
2006-01-10 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* insettext.C (getLabelList):
}
+/// Find the most suitable image format for images in \p format
+/// Note that \p format may be unknown (i. e. an empty string)
string findTargetFormat(string const & format, OutputParams const & runparams)
{
// Are we using latex or pdflatex?
if (from.empty()) {
lyxerr[Debug::GRAPHICS]
<< "\tCould not get file format." << endl;
- return orig_file;
}
string const to = findTargetFormat(from, runparams);
string const ext = formats.extension(to);