Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/imbuf/intern/bmp.c')
-rw-r--r--source/blender/imbuf/intern/bmp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c
index 31f8b651eff..f517a3c15e8 100644
--- a/source/blender/imbuf/intern/bmp.c
+++ b/source/blender/imbuf/intern/bmp.c
@@ -21,6 +21,8 @@
* \ingroup imbuf
*/
+#include <math.h>
+
#include "BLI_fileops.h"
#include "BLI_utildefines.h"
@@ -327,8 +329,8 @@ int imb_savebmp(ImBuf *ibuf, const char *name, int UNUSED(flags))
putShortLSB(is_grayscale ? 8 : 24, ofile);
putIntLSB(0, ofile);
putIntLSB(bytesize, ofile);
- putIntLSB((int)(ibuf->ppm[0] + 0.5), ofile);
- putIntLSB((int)(ibuf->ppm[1] + 0.5), ofile);
+ putIntLSB(round(ibuf->ppm[0] + 0.5), ofile);
+ putIntLSB(round(ibuf->ppm[1] + 0.5), ofile);
putIntLSB(0, ofile);
putIntLSB(0, ofile);