Improve error checking when saving images in TIFF format

Use TIFFFlush() in wxTIFFHandler::SaveFile() in order to check for
success when saving TIFF images, as TIFFClose() doesn't have any error
code to do it.

Closes #23214.

Closes #24072.
This commit is contained in:
BrianDelalex 2023-11-20 08:23:26 +01:00 committed by Vadim Zeitlin
parent 49ddc51007
commit 614135da5b

View file

@ -859,6 +859,20 @@ bool wxTIFFHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo
ptr += imageWidth * 3;
}
if (!TIFFFlush(tif))
{
if (verbose)
{
wxLogError( _("TIFF: Error flushing data.") );
}
TIFFClose(tif);
if (buf)
_TIFFfree(buf);
return false;
}
(void) TIFFClose(tif);
if (buf)