From 0bfd0c118ea28cf4a435d433e920ad26e04ec51a Mon Sep 17 00:00:00 2001 From: giraffedata Date: Tue, 11 Dec 2007 23:05:50 +0000 Subject: 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 --- converter/other/pamtotiff.c | 4 ++-- doc/HISTORY | 3 +++ 2 files changed, 5 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; } diff --git a/doc/HISTORY b/doc/HISTORY index 006b5d80..add0c2e6 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -25,6 +25,9 @@ not yet BJH Release 10.41.00 pamditherbw, pamsharpness, pamsharpmask, pamtopfm: fix crash due to write to arbitrary memory. + pamtotiff: fix incorrect pixels with PNM maxval != TIFF + maxval. + pnmcrop: fix -verbose message about background color with -white. -- cgit 1.4.1