From: <da...@us...> - 2008-04-03 20:12:52
|
Revision: 2992 http://hugin.svn.sourceforge.net/hugin/?rev=2992&view=rev Author: dangelo Date: 2008-04-03 13:12:48 -0700 (Thu, 03 Apr 2008) Log Message: ----------- fixed the "Can't close file description 11 (error 9: bad file descriptor)" during using autopano on Unix Modified Paths: -------------- hugin/trunk/src/hugin1/hugin/AutoCtrlPointCreator.cpp Modified: hugin/trunk/src/hugin1/hugin/AutoCtrlPointCreator.cpp =================================================================== --- hugin/trunk/src/hugin1/hugin/AutoCtrlPointCreator.cpp 2008-04-03 07:22:00 UTC (rev 2991) +++ hugin/trunk/src/hugin1/hugin/AutoCtrlPointCreator.cpp 2008-04-03 20:12:48 UTC (rev 2992) @@ -251,16 +251,14 @@ idx = autopanoArgs.Find(wxT("%i")); DEBUG_DEBUG("find %i in '"<< autopanoArgs.mb_str(wxConvLocal) << "' returned: " << idx); bool use_params = idx >=0; - if (use_namefile && use_params) { - wxMessageBox(_("Please use either %namefile or %i in the autopano-sift command line."), + idx = autopanoArgs.Find(wxT("%s")); + bool use_inputscript = idx >=0; + + if (! (use_namefile || use_params || use_inputscript)) { + wxMessageBox(_("Please use %namefile, %i or %s to specify the input files for autopano-sift"), _("Error in Autopano command"), wxOK | wxICON_ERROR); return cps; } - if ((! use_namefile) && (! use_params)) { - wxMessageBox(_("Please use %namefile or %i to specify the input files for autopano-sift"), - _("Error in Autopano command"), wxOK | wxICON_ERROR); - return cps; - } wxFile namefile; wxString namefile_name; @@ -294,10 +292,9 @@ autopanoArgs.Replace(wxT("%i"), wxString (imgFiles.c_str(), *wxConvFileName)); } - idx = autopanoArgs.Find(wxT("%s")); - wxFile ptoinfile; wxString ptoinfile_name; - if (idx) { + if (use_inputscript) { + wxFile ptoinfile; // create temporary project file ptoinfile_name = wxFileName::CreateTempFileName(wxT("ap_inproj"), &ptoinfile); autopanoArgs.Replace(wxT("%s"), ptoinfile_name); @@ -314,8 +311,8 @@ fclose(f); } #endif + ptoinfile.Close(); } - ptoinfile.Close(); #ifdef __WXMSW__ if (autopanoArgs.size() > 32000) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |