Received: by smtp02.oce.nl (4.1/SMI-4.1)
	id AA22178; Mon, 3 Aug 98 11:40:12 +0200
Received: from sgi.sgi.com (SGI.COM [192.48.153.1])
	by oce.nl (8.9.0/8.9.0) with ESMTP id LAA26026
	for <rvdt@oce.nl>; Mon, 3 Aug 1998 11:17:35 +0200 (MET DST)
Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) 
	by sgi.sgi.com (980309.SGI.8.8.8-aspam-6.2/980304.SGI-aspam:
       SGI does not authorize the use of its proprietary
       systems or networks for unsolicited or bulk email
       from the Internet.) 
	via ESMTP id CAA02702; Mon, 3 Aug 1998 02:15:38 -0700 (PDT)
	mail_from (owner-tiff@sgi.engr.sgi.com)
Received: (from majordomo-owner@localhost)
	by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF)
	id BAA67664
	for tiff-list;
	Mon, 3 Aug 1998 01:27:06 -0700 (PDT)
	mail_from (owner-tiff@sgi.sgi.com)
Received: from sgi.sgi.com (sgi.engr.sgi.com [192.26.80.37])
	by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF)
	via ESMTP id BAA74991
	for <tiff-relay@cthulhu.engr.sgi.com>;
	Mon, 3 Aug 1998 01:27:05 -0700 (PDT)
	mail_from (owner-tiff@sgi.sgi.com)
Received: from gateway.genasys.com.au (gw.genasys.com.au [203.8.170.1]) 
	by sgi.sgi.com (980309.SGI.8.8.8-aspam-6.2/980304.SGI-aspam:
       SGI does not authorize the use of its proprietary
       systems or networks for unsolicited or bulk email
       from the Internet.) 
	via SMTP id BAA23159
	for <tiff@sgi.com>; Mon, 3 Aug 1998 01:27:01 -0700 (PDT)
	mail_from (jonog@genasys.com.au)
Received: (from nobody@localhost) by gateway.genasys.com.au (8.6.9/8.6.9) id SAA04589 for <tiff@sgi.com>; Mon, 3 Aug 1998 18:26:58 +1000
Received: from postie.genasys.com.au(203.8.170.15) by gateway.genasys.com.au via smap (V2.0beta)
	id xma004587; Mon, 3 Aug 98 18:26:55 +1000
Received: from gisdev (gisdev.genasys.com.au) by postie with ESMTP
	($Revision: 1.37.109.26 $/16.2) id AA241972812; Mon, 3 Aug 1998 18:26:53 +1000
Received: by gisdev
	(1.39.111.2/16.2+g2) id AA230202812; Mon, 3 Aug 1998 18:26:52 +1000
From: Jonathan Gowland <jonog@genasys.com.au>
Message-Id: <199808030826.AA230202812@gisdev>
Subject: Problem with tiff2ps and byte order
To: tiff@sgi.com
Date: Mon, 3 Aug 1998 18:26:52 +1000 (EST)
X-Mailer: ELM [version 2.4 PL22]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-tiff@fddi-sgi.sgi.com
Precedence: bulk

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
