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:
parent
49ddc51007
commit
614135da5b
1 changed files with 14 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue