Received: by whizzer.wpd.sgi.com (921026.SGI.NOSTRIP/911001.SGI)
	 id AA21103; Thu, 27 May 93 13:21:53 GMT
Received: from sgi.sgi.com by whizzer.wpd.sgi.com via SMTP (921026.SGI.NOSTRIP/911001.SGI)
	for /usr/people/sam/majordomo/wrapper resend -l tiff -h sgi.sgi.com -f tiff-owner -s -m "-oi -odq -om" tiff-list id AA21096; Thu, 27 May 93 06:21:49 -0700
Received: from ucbvax.Berkeley.EDU by sgi.sgi.com via SMTP (920330.SGI/910110.SGI)
	for tiff-relay@whizzer.wpd.sgi.com id AA09014; Thu, 27 May 93 06:21:45 -0700
Received: from deneb.dfn.de by ucbvax.Berkeley.EDU (5.63/1.43)
	id AA15420; Thu, 27 May 93 06:21:29 -0700
Received: from fbihh.informatik.uni-hamburg.de by deneb.dfn.de (4.1/SMI-4.2)
	id AA04954; Thu, 27 May 93 15:20:55 +0200
Received: from kogs26.informatik.uni-hamburg.de
	by fbihh.informatik.uni-hamburg.de (5.65+/FBIHH-1.6) with SMTP;
	id AA19792; Thu, 27 May 93 15:20:55 +0200
From: hlange@kogs26.informatik.uni-hamburg.de (Harald Lange)
Date: Thu, 27 May 93 15:20:53 +0200
Message-Id: <9305271320.AA12503@kogs26.informatik.uni-hamburg.de>
Received: by kogs26.informatik.uni-hamburg.de (4.1/FBIHH-2.23);
	id AA12503; Thu, 27 May 93 15:20:53 +0200
To: tiff@ucbvax.Berkeley.EDU
Subject: modified version of xtiff.c
Sender: tiff-owner@sgi.sgi.com

we have used xtiff (Revision 2.0 90/12/20, actual version coming with TIFF
3.21) for displaying RGB-images (24bit) on our Sun 4/370 (32bit
TAAC-Framebuffer) under X-Windows, but the result was not satisfying. A little
look to the source reveal some typing errors in the index-value of the
pixel_map variable, which we have corrected.

Another important change is the new name for the tagfield
TIFFTAG_TRANSFERFUNCTION, which is now called TIFFTAG_COLORRESPONSECURVE.

Beyond that we have made the following expansions to xtiff:

	1.) Show Pagenumber Tagfield if present
	2.) Consider Fillorder Tagfield

I think it is a good idea to make this corrected version available in the
following TIFFLibrary Distribution. I have tried to mail these bug to Dan Sears
directly, but the mail came back, because of unknown user dbs@decwrl.dec.com

P.S.: it follows the diff output between original and corrected version of
      xtiff.c

#-------------- Begin Output from diff ----------------------------------
35c35
<  * both a TIFFTAG_COLORMAP and a TIFFTAG_TRANSFERFUNCTION.  This
---
>  * both a TIFFTAG_COLORMAP and a TIFFTAG_COLORRESPONSECURVE.  This
37c37
<  * a TIFFTAG_TRANSFERFUNCTION is tfBitsPerSample bits wide for each
---
>  * a TIFFTAG_COLORRESPONSECURVE is tfBitsPerSample bits wide for each
39c39
<  * In this case, TIFFTAG_TRANSFERFUNCTION is ignored.
---
>  * In this case, TIFFTAG_COLORRESPONSECURVE is ignored.
457c457
<         if (!TIFFGetField(tfFile, TIFFTAG_TRANSFERFUNCTION,
---
>         if (!TIFFGetField(tfFile, TIFFTAG_COLORRESPONSECURVE,
539d538
<     short cur_page, number_of_pages;
544,551d542
<       /* if TAGFIELD Pagenumber exist, show its value, otherwise
< 	 display number of directory (HL 28.9.92)
<       */
<       if (TIFFGetField(tfFile, TIFFTAG_PAGENUMBER,
< 		       &cur_page, &number_of_pages))
< 	sprintf(buffer, "%s - page %d from %d", fileName,
< 		cur_page, number_of_pages);
<       else
800c791
<             green_shift = pixel_map[1] = xGreenMask == 0xFF000000 ? 0
---
>             green_shift = pixel_map[0] = xGreenMask == 0xFF000000 ? 0
802c793
<             blue_shift = pixel_map[2] = xBlueMask == 0xFF000000 ? 0
---
>             blue_shift = pixel_map[0] = xBlueMask == 0xFF000000 ? 0
910,911d900
<     u_short fillorder; /* FILLORDER has to be considered ! (HL 29.9.92) */
< 
923,925c912,913
<     /* libtiff converts LSB byte ordering to MSB byte ordering, but doesn't
<      * change the FillOrder of bits in a byte. The FillOrder TAGFIELD shows us,
<      * how to interpret the separate samples within a byte. (HL 29.9.92)
---
>     /*
>      * libtiff converts LSB data into MSB but doesn't change the FillOrder tag.
927d914
<     TIFFGetFieldDefaulted(tfFile, TIFFTAG_FILLORDER, &fillorder);
929d915
<       if (fillorder == FILLORDER_MSB2LSB)
931,940d916
<       else
< 	xImage->bitmap_bit_order = LSBFirst;
< 
<     /* I don't know, why byte_order has to be set, in dependence on the
<        fillorder within a byte. The libtiff only supply MSB2LSB byte ordering
<        data, which is the actual machine representation (Sun 4).
< 
<        The meaning of the xImage->byte_order field is not clear,
<        but it works!!! (HL 29.9.92)
<     */
942d917
<       if (fillorder == FILLORDER_MSB2LSB)
944,945d918
<       else
<         xImage->byte_order = LSBFirst;
1018c991
< QuitProc()
---
> QuitProc(void)

#-------------- End Output from diff ----------------------------------

Harald Lange                                 |   Universitaet Hamburg
                                             |   Fachbereich Informatik
Phone: +49 40 4123 6144                      |   Bodenstedtstrasse 16
FAX:   +49 40 4123 6530                      |   D-2000 Hamburg 50
Email: hlange@informatik.uni-hamburg.de      |   Fed. Rep. Germany
-------------------------------------------------------------------------------


