AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

1998.08.03 08:26 "Problem with tiff2ps and byte order", by Jonathan Gowland

I have the following problem:

I start with a BMP file generated on Windows NT using PaintShop Pro.

I then read the file into XV and save it as a TIFF file with LZW compression.

If I then run tiff2ps (3.4-beta037) on a big-endian system (HP-UX), (using tiff2ps -2 -z) the image in encapsulated PostScript file is screwed up (as shown using Display PostScript and a HP LaserJet 5M).

If I run tiff2ps on a little-endian box (running Solaris x86), the resulting EPS image is OK.

If I save the image (from XV on a big-endian system) with either no compression or PackBits), and then run tiff2ps, the resulting image is OK.

While these workarounds seem OK, (a) there are other reasons why we need to be able to run tiff2ps on HP-UX and (b) we need to use LZW compression, since the saving in file size is important. (Running on HP-UX, we have successfully used tiff2ps on many LZW-compressed TIFF images, where those images originated on HP-UX, and some, but not all, images originating on NT seem to convert OK.)

Is there a problem with tiff2ps involving LZW and byte-order handling? Is there some way I can massage the TIFF file so I can still save it with LZW, but tiff2ps will handle it OK?

I don't know whether it's any help, but this is what tiffinfo reports for the problem file:

TIFF Directory at offset 0xed6
    Image Width: 351 Image Length: 239
    Resolution: 1200, 1200 pixels/inch
    Bits/Sample: 8
    Compression Scheme: LZW
    Photometric Interpretation: palette color (RGB from colormap)
    Orientation: row 0 top, col 0 lhs
    Samples/Pixel: 1
    Rows/Strip: 239
    Planar Configuration: single image plane
    Color Map: (present)

And this is what it reports for a file which tiff2ps handles OK:

TIFF Directory at offset 0x3342
    Subfile Type: (0 = 0x0)
    Image Width: 542 Image Length: 342
    Resolution: 300, 300 pixels/inch
    Bits/Sample: 8
    Compression Scheme: LZW
    Photometric Interpretation: palette color (RGB from colormap)
    Samples/Pixel: 1
    Rows/Strip: 8
    Planar Configuration: single image plane
    Color Map: (present)
    Predictor: none 1 (0x1)

Jonathan Gowland
Genasys Ltd