From 9f3f8e3f8fcf41ba828239a8e5fb6333600eb3d2 Mon Sep 17 00:00:00 2001 From: Simon Budig Date: Sun, 26 Feb 2006 21:55:40 +0000 Subject: [PATCH] properly round the resolution entry. Fixes bug #332501. 2006-02-26 Simon Budig * plug-ins/bmp/bmpwrite.c: properly round the resolution entry. Fixes bug #332501. --- ChangeLog | 5 +++++ plug-ins/bmp/bmpwrite.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b197eaf73c..0570448184 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-02-26 Simon Budig + + * plug-ins/bmp/bmpwrite.c: properly round the resolution entry. + Fixes bug #332501. + 2005-06-26 Hans Breuer * **/makefile.msc app/gimpcore.def : updated diff --git a/plug-ins/bmp/bmpwrite.c b/plug-ins/bmp/bmpwrite.c index f253163957..a0503de5d1 100644 --- a/plug-ins/bmp/bmpwrite.c +++ b/plug-ins/bmp/bmpwrite.c @@ -268,9 +268,11 @@ WriteBMP (const gchar *filename, * n dots inch 100 cm m dots * ------ * ------- * ------ = ------ * inch 2.54 cm m inch + * + * We add 0.5 for proper rounding. */ - Bitmap_Head.biXPels = (long int) (xresolution * 100.0 / 2.54); - Bitmap_Head.biYPels = (long int) (yresolution * 100.0 / 2.54); + Bitmap_Head.biXPels = (long int) (xresolution * 100.0 / 2.54 + 0.5); + Bitmap_Head.biYPels = (long int) (yresolution * 100.0 / 2.54 + 0.5); } }