possibility to create directories when saving new textures

This commit is contained in:
alemuntoni 2021-09-14 18:27:24 +02:00
parent 1a4c349b52
commit e5b9fbefb3

View File

@ -334,6 +334,14 @@ void saveImage(
PluginManager& pm = meshlab::pluginManagerInstance();
IOPlugin *ioPlugin = pm.outputImagePlugin(extension);
std::cerr << "Path: " << fi.path().toStdString() << "\n";
if (!fi.path().isEmpty()){
if (!QDir(fi.path()).exists()){
QDir().mkdir(fi.path());
}
}
if (ioPlugin == nullptr)
throw MLException(
"Image " + filename + " cannot be saved. Your MeshLab version "