* wrbmp.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
+ * Modified 2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
/* File size */
headersize = 14 + 40 + cmap_entries * 4; /* Header and colormap */
bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height;
-
+
/* Set unused fields of header to 0 */
MEMZERO(bmpfileheader, SIZEOF(bmpfileheader));
MEMZERO(bmpinfoheader, SIZEOF(bmpinfoheader));
/* File size */
headersize = 14 + 12 + cmap_entries * 3; /* Header and colormap */
bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height;
-
+
/* Set unused fields of header to 0 */
MEMZERO(bmpfileheader, SIZEOF(bmpfileheader));
MEMZERO(bmpcoreheader, SIZEOF(bmpcoreheader));
progress->completed_extra_passes++;
/* Make sure we wrote the output file OK */
- fflush(outfile);
- if (ferror(outfile))
+ JFFLUSH(outfile);
+ if (JFERROR(outfile))
ERREXIT(cinfo, JERR_FILE_WRITE);
}
((j_common_ptr) cinfo, JPOOL_IMAGE, row_width, (JDIMENSION) 1);
dest->pub.buffer_height = 1;
- return (djpeg_dest_ptr) dest;
+ return &dest->pub;
}
#endif /* BMP_SUPPORTED */