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.31 13:39 "RE: [Tiff] How to save in tiff format file?", by

Toh wrote:

    I have tried the solution provided you all. It

seems that my saved file nw look distorted. Think the problem now lies in the TIFF I am reading is in different format(by Gerben Vos.). The meaning of different format, does it mean by the intilaiasation of the array when reading the tiff file?

For background info: My Gheight & Gwidth got from function which is reading the image file. And the constant XSIZE & YSIZE is defined as 256. From my understanding, I know XSIZE must be equal to my Gwidth & YSIZE is equal to Gheight. So equate them to the same value.

If you are trying to keep the original image dimensions, you should get rid of your XSIZE and YSIZE definitions, and use the dimension values from the original image (Gheight, Gwidth). But you will probably want to allocate your array dynamically, because you can't use variables to declare array bounds.

e.g.
// (Gwidth and Gheight should already be set at this point)
unsigned char * array = new unsigned char[Gwidth * Gheight];

// don't forget to check if allocated okay, and also to 'delete [] array' at the end of your function

Now we're starting to talk more about C/C++ than TIFF, so I'll stop here... :-)