about summary refs log tree commit diff
path: root/converter/other
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-12-11 23:05:50 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-12-11 23:05:50 +0000
commit0bfd0c118ea28cf4a435d433e920ad26e04ec51a (patch)
tree46dee4abcd182997a05c46c3afb3a65d6208242c /converter/other
parent405ceae2f5ef0cd237b607889e55455f4cc34640 (diff)
downloadnetpbm-mirror-0bfd0c118ea28cf4a435d433e920ad26e04ec51a.tar.gz
netpbm-mirror-0bfd0c118ea28cf4a435d433e920ad26e04ec51a.tar.xz
netpbm-mirror-0bfd0c118ea28cf4a435d433e920ad26e04ec51a.zip
fix incorrect pixels with PNM maxval != TIFF maxval
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@486 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other')
-rw-r--r--converter/other/pamtotiff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/converter/other/pamtotiff.c b/converter/other/pamtotiff.c
index 4174a431..49123d4f 100644
--- a/converter/other/pamtotiff.c
+++ b/converter/other/pamtotiff.c
@@ -351,10 +351,10 @@ putSample(sample           const s,
     if (maxval != tiff_maxval)
         s2 = s * tiff_maxval / maxval;
     if (bitspersample > 8) {
-        *((unsigned short *)(*tPP)) = s;
+        *((unsigned short *)(*tPP)) = s2;
         (*tPP) += sizeof(short);
     } else
-        *(*tPP)++ = s & 0xff;
+        *(*tPP)++ = s2 & 0xff;
 }