AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
March 1994

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



1994.03.08 22:08 "Re: NeXT to standard X11 Image/Pixmap (really bug in TIFFWriteDirectory)", by Sam Leffler

    To:  Sam Leffler <sam>
    Subject:  Re: NeXT to standard X11 Image/Pixmap 
    Date: Mon, 07 Mar 1994 22:23:01 EST
    From:  Matt Willis <willis@euclid.stetson.edu>

    
    
    On Mon, 7 Mar 1994, Sam Leffler wrote:
    
    > If you told me how you were trying to do this I might be able to
    > help.  I don't recall if tiffcp extracts alpha or not.  If not it
    > would seem to be logic place to start.
    > 
    >     Sam
    > 
    
    Both tiffcp and tiffsplit strip out the Alpha values. I'm adding 
    a uuencoded sample NeXT tiff to show what I mean...
    
    I'm running tiffsplit on the file, to seperate out the black and white 
    and color images... then converting the color image to be displayed, but 
    I need the alpha values to be preserved...
    
Your problem turns out to be a bug in the directory writing code;
the alpha *data* are actually present in the file.  Apply this
patch to tif_dirwrite.c to insure the ExtraSamples tag is written.

	Sam

*** 1.31	1993/08/26 14:24:07
--- tif_dirwrite.c	1994/03/08 22:03:48
***************
*** 163,169 ****
  	 * Write out ExtraSamples tag only if
  	 * extra samples are present in the data.
  	 */
! 	if (FieldSet(fields, FIELD_EXTRASAMPLES) && td->td_extrasamples) {
  		ResetFieldBit(fields, FIELD_EXTRASAMPLES);
  		nfields--;
  		dirsize -= sizeof (TIFFDirEntry);
--- 163,169 ----
  	 * Write out ExtraSamples tag only if
  	 * extra samples are present in the data.
  	 */
! 	if (FieldSet(fields, FIELD_EXTRASAMPLES) && td->td_extrasamples == 0) {
  		ResetFieldBit(fields, FIELD_EXTRASAMPLES);
  		nfields--;
  		dirsize -= sizeof (TIFFDirEntry);