AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

1993.05.27 13:20 "modified version of xtiff.c", by Harald Lange
1993.06.21 17:51 "Re: modified version of xtiff.c", by Sam Leffler

1993.05.27 13:20 "modified version of xtiff.c", by Harald Lange

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
-------------------------------------------------------------------------------