summaryrefslogtreecommitdiffstats
path: root/generic/tkImgPNG.c
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2020-06-23 19:46:58 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2020-06-23 19:46:58 (GMT)
commit0fdcaa049e07325d3f3890235edd399fcd238311 (patch)
tree08086ba0fc4f1b288f59616020618d250d9d2918 /generic/tkImgPNG.c
parent66ac6b6c7081489c23289749ded3ba20919f1ea0 (diff)
downloadtk-0fdcaa049e07325d3f3890235edd399fcd238311.zip
tk-0fdcaa049e07325d3f3890235edd399fcd238311.tar.gz
tk-0fdcaa049e07325d3f3890235edd399fcd238311.tar.bz2
TIP529 image metadata: make compile on MS-VC6
Diffstat (limited to 'generic/tkImgPNG.c')
-rw-r--r--generic/tkImgPNG.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c
index 852bdf3..91eb393 100644
--- a/generic/tkImgPNG.c
+++ b/generic/tkImgPNG.c
@@ -3557,7 +3557,7 @@ WriteExtraChunks(
{
return TCL_ERROR;
}
- PPUx = (unsigned long)round(DPIValue / 0.0254);
+ PPUx = (unsigned long)floor(DPIValue / 0.0254+0.5);
if (aspectObj == NULL) {
PPUy = PPUx;
}
@@ -3576,9 +3576,9 @@ WriteExtraChunks(
if (DPIObj == NULL) {
unitSpecifier = 0;
PPUx = 65536;
- PPUy = (unsigned long)round(65536.0 * aspectValue);
+ PPUy = (unsigned long)floor(65536.0 * aspectValue+0.5);
} else {
- PPUy = (unsigned long)round(DPIValue * aspectValue / 0.0254);
+ PPUy = (unsigned long)floor(DPIValue * aspectValue / 0.0254+0.5);
}
}
if (DPIObj != NULL || aspectObj != NULL) {