add error message

when zlib version is < 1.2.9, it is not possible to save an image as .inr,
it has to be .inr.gz
no matter if zlib is available or not

this commit adds an error message to help the user understand the error
This commit is contained in:
Jane Tournois 2019-12-05 16:29:11 +01:00
parent 3c8da31ed2
commit adeb6b391e
1 changed files with 9 additions and 4 deletions

View File

@ -497,14 +497,19 @@ void _openWriteImage(_image* im, const char *name)
#endif
im->openMode = OM_GZ;
}
#if CGAL_USE_GZFWRITE
else
else
{
#if CGAL_USE_GZFWRITE
im->fd = (_ImageIO_file) gzopen(name, "wb");
im->openMode = OM_FILE;
}
#endif// CGAL_USE_GZFWRITE
#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->openMode = OM_FILE;