* Source/NSBitmapImageRep.m: Reduce floating-point error in the

expression which computes image point size using DPI and pixel size
(for TIFF images.)


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33293 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2011-06-13 22:09:52 +00:00
parent 00e106040c
commit af6f2c29bc
2 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2011-06-13 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSBitmapImageRep.m: Reduce floating-point error in the
expression which computes image point size using DPI and pixel size
(for TIFF images.)
2011-06-13 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSImageRep.m (-description): Implement -description to

View file

@ -1915,10 +1915,11 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
[_properties setObject: [NSNumber numberWithFloat: _comp_factor]
forKey: NSImageCompressionFactor];
if (info->xdpi > 0 && info->ydpi > 0)
if (info->xdpi > 0 && info->xdpi != 72 &&
info->ydpi > 0 && info->ydpi != 72)
{
NSSize pointSize = NSMakeSize((info->width / info->xdpi) * 72.0,
(info->height / info->ydpi) * 72.0);
NSSize pointSize = NSMakeSize((double)info->width * (72.0 / (double)info->xdpi),
(double)info->height * (72.0 / (double)info->ydpi));
[self setSize: pointSize];
}