#include <synfig/canvas.h>
#include "asyncrenderer.h"
+#include "general.h"
+
#endif
/* === U S I N G =========================================================== */
RenderSettings::on_render_pressed()
{
String filename=entry_filename.get_text();
+ synfig::String calculated_target_name(target_name);
if(filename.empty())
{
// If the target type is not yet defined,
// try to figure it out from the outfile.
- if(target_name.empty())
+ if(calculated_target_name.empty())
{
try
{
String ext(filename_extension(filename));
if (ext.size()) ext=ext.substr(1); // skip initial '.'
+ synfig::info("render target filename: '%s'; extension: '%s'", filename.c_str(), ext.c_str());
if(Target::ext_book().count(ext))
- target_name=Target::ext_book()[ext];
+ {
+ calculated_target_name=Target::ext_book()[ext];
+ synfig::info("'%s' is a known extension - using target '%s'", ext.c_str(), calculated_target_name.c_str());
+ }
else
- target_name=ext;
+ {
+ calculated_target_name=ext;
+ synfig::info("unknown extension");
+ }
}
catch(std::runtime_error x)
{
}
}
- if(filename.empty() && target_name!="null")
+ if(filename.empty() && calculated_target_name!="null")
{
canvas_interface_->get_ui_interface()->error(_("A filename is required for this target"));
return;
}
- Target::Handle target=Target::create(target_name,filename);
+ Target::Handle target=Target::create(calculated_target_name,filename);
if(!target)
{
canvas_interface_->get_ui_interface()->error(_("Unable to create target for ")+filename);
target->set_rend_desc(&rend_desc);
target->set_quality((int)adjustment_quality.get_value());
if( !target->init() ){
- canvas_interface_->get_ui_interface()->error(_("Target initialisation failure"));
+ canvas_interface_->get_ui_interface()->error(_("Target initialization failure"));
return;
}