Added check if write succeeded.

This commit is contained in:
mkazhdan
2018-10-30 11:09:34 -04:00
parent 44ba73aced
commit 830de154b2
6 changed files with 11 additions and 6 deletions
+2 -1
View File
@@ -139,7 +139,8 @@ struct RGBPixel
void WriteImage( char* fileName , RGBPixel* pixels , int w , int h )
{
unsigned int _w = w , _h = h , _c = 3;
ImageWriter::Write( fileName , (const unsigned char*)pixels , _w , _h , _c );
if( !ImageWriter::Write( fileName , (const unsigned char*)pixels , _w , _h , _c ) )
fprintf( stderr , "[ERROR] Could not write image to: %s\n" , fileName ) , exit( 0 );
}
struct Profiler