summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhpa <hpa>2001-05-09 17:48:31 +0000
committerhpa <hpa>2001-05-09 17:48:31 +0000
commit36c7383733ea8c10b967a07be667545ab89cb37b (patch)
treeab365a6ba45d175586e51d3a087a8129b5189ea6
parent553446f440297f81a68df56f9a03b39852ef7292 (diff)
downloadsyslinux-36c7383733ea8c10b967a07be667545ab89cb37b.tar.gz
Correct the handling of "equal buckets conversion". This is probably
correct, but risks floating-point errors, which is a major concern.
-rwxr-xr-xppmtolss166
1 files changed, 3 insertions, 3 deletions
diff --git a/ppmtolss16 b/ppmtolss16
index 357a6012..8c467fc1 100755
--- a/ppmtolss16
+++ b/ppmtolss16
@@ -53,9 +53,9 @@ sub rgbconvert($$) {
my($r,$g,$b);
($r, $g, $b) = unpack("CCC", $rgb);
- $r = int($r*$maxmult+0.5);
- $g = int($g*$maxmult+0.5);
- $b = int($b*$maxmult+0.5);
+ $r = int($r*$maxmult);
+ $g = int($g*$maxmult);
+ $b = int($b*$maxmult);
$rgb = pack("CCC", $r, $g, $b);
return $rgb;
}