]> git.imager.perl.org - imager.git/commitdiff
- change faxable output to use a more fax natural PHOTOMETRIC_MINISWHITE,
authorTony Cook <tony@develop=help.com>
Tue, 31 Jan 2006 00:06:47 +0000 (00:06 +0000)
committerTony Cook <tony@develop=help.com>
Tue, 31 Jan 2006 00:06:47 +0000 (00:06 +0000)
  since T.4 normally works that way, and MINISBLACK confuses some readers.

Changes
tiff.c

diff --git a/Changes b/Changes
index bc950c18af6cc56ffcae2652c05731105a8266ba..4a16b5d09dd5b28d4435d4a88e72f99dcc33173f 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1323,6 +1323,8 @@ Revision history for Perl extension Imager.
 - eliminate many -Wall warnings
 - update README to match unbuggy giflib
 - document index parameter of Imager::Font->new()
+- change faxable output to use a more fax natural PHOTOMETRIC_MINISWHITE, 
+  since T.4 normally works that way, and MINISBLACK confuses some readers.
 
 =================================================================
 
diff --git a/tiff.c b/tiff.c
index 2ac76674f55a80f00cc8280b4706a2fd5afec1d8..ec6911ce2e3265b9f3555eac340086a1950275e9 100644 (file)
--- a/tiff.c
+++ b/tiff.c
@@ -580,7 +580,7 @@ i_writetiff_low_faxable(TIFF *tif, i_img *im, int fine) {
     { mm_log((1, "i_writetiff_wiol_faxable: TIFFSetField bitpersample=1\n")); return 0; }
   if (!TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG))
     { mm_log((1, "i_writetiff_wiol_faxable: TIFFSetField planarconfig\n")); return 0; }
-  if (!TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK))
+  if (!TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE))
     { mm_log((1, "i_writetiff_wiol_faxable: TIFFSetField photometric=%d\n", PHOTOMETRIC_MINISBLACK)); return 0; }
   if (!TIFFSetField(tif, TIFFTAG_COMPRESSION, 3))
     { mm_log((1, "i_writetiff_wiol_faxable: TIFFSetField compression=3\n")); return 0; }
@@ -620,7 +620,7 @@ i_writetiff_low_faxable(TIFF *tif, i_img *im, int fine) {
       bits = width-x; if(bits>8) bits=8;
       i_gsamp(im, x, x+8, y, luma, &luma_chan, 1);
       for(bitpos=0;bitpos<bits;bitpos++) {
-       linebuf[linebufpos] |= ((luma[bitpos]>=128)?bitval:0);
+       linebuf[linebufpos] |= ((luma[bitpos] < 128) ? bitval : 0);
        bitval >>= 1;
       }
       linebufpos++;