AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2006.07.21 12:40 "[Tiff] How to save in tiff format file?", by Toh kc
2006.07.21 17:16 "RE: [Tiff] How to save a tiff format file?", by
2006.07.25 11:45 "Re: [Tiff] How to save in tiff format file?", by Gerben Vos
2006.07.25 13:41 "RE: [Tiff] How to save in tiff format file?", by
2006.07.30 10:36 "Re: [Tiff] How to save in tiff format file?", by Toh kc
2006.07.31 13:39 "RE: [Tiff] How to save in tiff format file?", by
2006.08.02 02:09 "RE: [Tiff] How to save in tiff format file?", by Toh kc
2006.08.02 10:14 "Re: [Tiff] How to save in tiff format file?", by Gerben Vos
2006.08.02 17:27 "RE: [Tiff] How to save in tiff format file?", by
2006.08.16 02:05 "[Tiff] Re: How to save in tiff format file?", by Toh kc
2006.08.24 13:38 "Re: [Tiff] Re: How to save in tiff format file?", by Gerben Vos
2006.08.24 14:56 "Re: [Tiff] Re: How to save in tiff format file?", by Toh kc

2006.07.21 17:16 "RE: [Tiff] How to save a tiff format file?", by

Toh wrote:

     for (int i = 0; i < YSIZE; i++)
            for(int j = 0; j < XSIZE; j++)
                    array[i * XSIZE + j] = (unsigned
char)(j * i);

> for (int k = 0; k < Gheight; k++)

                 {
                        TIFFWriteScanline(dif, &array[k], k);
                }

It would appear that since you're using 'YSIZE' to control the image height/length in one instance, and 'Gheight' in another, that if there's a difference between the two values, you'll have one of two problems happening:

  1. YSIZE > Gheight : you won't write all of the scanlines to the target TIFF (what you've described)
  2. YSIZE < Gheight : you'll get an access violation when you start to index 'array' beyond its allocated size

So, I guess it's time to synchronize 'YSIZE' and 'Gheight' (or fold them into one, ideally, no?).

P.S. Please try to be more careful, to avoid sending duplicate messages to the list. ;-)