Author: Diego Barrios Romero <[email protected]>
Date:   Sun Feb 26 18:08:21 2012 +0100

output figure out and check

---

 synfig-core/src/tool/main.cpp |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/synfig-core/src/tool/main.cpp b/synfig-core/src/tool/main.cpp
index 9ba0cc9..24f5da1 100644
--- a/synfig-core/src/tool/main.cpp
+++ b/synfig-core/src/tool/main.cpp
@@ -691,7 +691,35 @@ int main(int ac, char* av[])
                // TODO: Add ffmpeg target parameters support
                TargetParam target_parameters;
 
-               // ...
+               // If no output filename was provided, then create a output 
filename
+               // based on the given input filename and the selected target.
+               // (ie: change the extension)
+               if(job_list.front().outfilename.empty())
+               {
+                       job_list.front().outfilename =
+                               
filename_sans_extension(job_list.front().filename()) + '.';
+
+                       if(Target::book().count(target_name))
+                               job_list.front().outfilename +=
+                                       Target::book()[target_name].filename;
+                       else
+                               job_list.front().outfilename += target_name;
+               }
+
+               VERBOSE_OUT(4) << "Target name = " << target_name << endl;
+               VERBOSE_OUT(4) << "Outfilename = " << 
job_list.front().outfilename
+                                          << endl;
+
+               // Check permissions
+               if (access(dirname(job_list.front().outfilename).c_str(), W_OK) 
== -1)
+               {
+                       cerr << _("Unable to create ouput for ")
+                                << job_list.front().outfilename + ": " + 
strerror(errno)
+                                << endl;
+                       job_list.pop_front();
+                       cerr << _("Throwing out job...") << endl;
+               }
+
 
                // Process Job list --------------------------------------------
 


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to