mirror of https://github.com/CGAL/cgal
Merge pull request #4396 from janetournois/Polyedron_demo-fix_image_io-jtournois
ImageIO and Polyhedron demo - Add error message when `io_image_plugin` can't save
This commit is contained in:
commit
230850220e
|
|
@ -497,14 +497,19 @@ void _openWriteImage(_image* im, const char *name)
|
||||||
#endif
|
#endif
|
||||||
im->openMode = OM_GZ;
|
im->openMode = OM_GZ;
|
||||||
}
|
}
|
||||||
#if CGAL_USE_GZFWRITE
|
else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
#if CGAL_USE_GZFWRITE
|
||||||
im->fd = (_ImageIO_file) gzopen(name, "wb");
|
im->fd = (_ImageIO_file) gzopen(name, "wb");
|
||||||
im->openMode = OM_FILE;
|
im->openMode = OM_FILE;
|
||||||
}
|
|
||||||
#endif// CGAL_USE_GZFWRITE
|
|
||||||
#else
|
#else
|
||||||
|
fprintf(stderr, "_openWriteImage: error: zlib version 1.2.9 or later\n"
|
||||||
|
"is required to save in non-compressed files\n");
|
||||||
|
return;
|
||||||
|
#endif// CGAL_USE_GZFWRITE
|
||||||
|
}
|
||||||
|
|
||||||
|
#else //CGAL_USE_ZLIB
|
||||||
{
|
{
|
||||||
im->fd = (_ImageIO_file) fopen(name, "wb");
|
im->fd = (_ImageIO_file) fopen(name, "wb");
|
||||||
im->openMode = OM_FILE;
|
im->openMode = OM_FILE;
|
||||||
|
|
|
||||||
|
|
@ -2130,10 +2130,13 @@ void MainWindow::save(QString filename, QList<CGAL::Three::Scene_item*>& to_save
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!saved)
|
if(!saved)
|
||||||
|
{
|
||||||
QMessageBox::warning(this,
|
QMessageBox::warning(this,
|
||||||
tr("Cannot save"),
|
tr("Cannot save"),
|
||||||
tr("The selected object %1 was not saved. (Maybe a wrong extension ?)")
|
tr("The selected object %1 was not saved. (Maybe a wrong extension ?)")
|
||||||
.arg(to_save.front()->name()));
|
.arg(to_save.front()->name()));
|
||||||
|
to_save.pop_front();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionSaveSnapshot_triggered()
|
void MainWindow::on_actionSaveSnapshot_triggered()
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,8 @@ public:
|
||||||
|
|
||||||
point_image p_im = *im_item->image()->image();
|
point_image p_im = *im_item->image()->image();
|
||||||
bool ok = _writeImage(&p_im, fileinfo.filePath().toUtf8()) == 0;
|
bool ok = _writeImage(&p_im, fileinfo.filePath().toUtf8()) == 0;
|
||||||
items.pop_front();
|
if(ok)
|
||||||
|
items.pop_front();
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
QString name() const override{ return "segmented images"; }
|
QString name() const override{ return "segmented images"; }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue