t2p.c

changeset 47
bfc6aaa089b0
parent 46
20fda1ec5f17
child 48
3d0be1c1c1b2
     1.1 diff -r 20fda1ec5f17 -r bfc6aaa089b0 t2p.c
     1.2 --- a/t2p.c	Sun Aug 25 13:22:42 2002 +0000
     1.3 +++ b/t2p.c	Mon Aug 26 05:43:49 2002 +0000
     1.4 @@ -4,7 +4,7 @@
     1.5   *      will be compressed using ITU-T T.6 (G4) fax encoding.
     1.6   *
     1.7   * Main program
     1.8 - * $Id: t2p.c,v 1.17 2002/08/25 05:22:42 eric Exp $
     1.9 + * $Id: t2p.c,v 1.18 2002/08/25 21:43:49 eric Exp $
    1.10   * Copyright 2001 Eric Smith <eric@brouhaha.com>
    1.11   *
    1.12   * This program is free software; you can redistribute it and/or modify
    1.13 @@ -26,7 +26,10 @@
    1.14  #include <stdio.h>
    1.15  #include <stdlib.h>
    1.16  #include <unistd.h>
    1.17 +
    1.18  #include <tiffio.h>
    1.19 +#define TIFF_REVERSE_BITS
    1.20 +
    1.21  #include <panda/functions.h>
    1.22  #include <panda/constants.h>
    1.23  
    1.24 @@ -377,6 +380,11 @@
    1.25  	goto fail;
    1.26        }
    1.27  
    1.28 +#ifdef TIFF_REVERSE_BITS
    1.29 +  reverse_bits ((u8 *) bitmap->bits,
    1.30 +		image_length * bitmap->row_words * sizeof (word_type));
    1.31 +#endif /* TIFF_REVERSE_BITS */
    1.32 +
    1.33    if (input_attributes.has_page_size)
    1.34      bitmap = resize_bitmap (bitmap,
    1.35  			    x_resolution,
    1.36 @@ -415,6 +423,11 @@
    1.37    TIFFSetField (tiff_temp, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX4);
    1.38    TIFFSetField (tiff_temp, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);
    1.39  
    1.40 +#ifdef TIFF_REVERSE_BITS
    1.41 +  reverse_bits ((u8 *) bitmap->bits,
    1.42 +		image_length * bitmap->row_words * sizeof (word_type));
    1.43 +#endif /* TIFF_REVERSE_BITS */
    1.44 +
    1.45    for (row = 0; row < rect_height (& bitmap->rect); row++)
    1.46      if (1 != TIFFWriteScanline (tiff_temp,
    1.47  				bitmap->bits + row * bitmap->row_words,