diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index 35c935051..5a06d8203 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -27,6 +27,8 @@ # include "InventorAll.h" # include # include +# include +# include # include # include # include @@ -689,6 +691,10 @@ Py::Object View3DInventorPy::saveImage(const Py::Tuple& args) if (!PyArg_ParseTuple(args.ptr(), "s|iiss",&cFileName,&w,&h,&cColor,&cComment)) throw Py::Exception(); + QFileInfo fi(QString::fromUtf8(cFileName)); + if (!fi.absoluteDir().exists()) + throw Py::RuntimeError("Directory where to save image doesn't exist"); + QColor bg; QString colname = QString::fromLatin1(cColor); if (colname.compare(QLatin1String("Current"), Qt::CaseInsensitive) == 0)