- 2008.02.11 16:03 "Re: [Tiff] TIFFReadRGBAImage rendering upside-down", by Frank Warmerdam
-
2008.02.11 17:20 "RE: [Tiff] Re: Help with TIFFWriteScanline()", by Chris Cox
- 2008.02.11 15:52 "[Tiff] Help with TIFFWriteScanline()", by James Sumners
- 2008.02.12 02:31 "Re: [Tiff] Re: Help with TIFFWriteScanline()", by James Sumners
- 2008.02.12 00:29 "RE: [Tiff] TIFFReadRGBAImage rendering upside-down", by Mick O'Neill
- 2008.02.12 01:27 "RE: [Tiff] TIFFReadRGBAImage rendering upside-down", by Mick O'Neill
2008.02.11 17:11 "Re: [Tiff] Help with TIFFWriteScanline()", by Gerben Vos
I've written a program[1] that reads a grayscale image into memory and
> writes it to another file. What am I doing wrong?
[1] -- http://student.claytonstate.net/~jsumners/files/tiff_copy.zip
SamplesPerPixel is 8 in the output file. This should be 1, like it is in the input file. I'm not sure how your code causes this.
Some general tips: look at the values and especially the buffer sizes that your program computes, and check by hand if the values are what you want. It's easy to confuse the number of bits with the number of bytes, for example. Also, sometimes TIFFGetField() with its variable argument causes problems when you pass an uint32 * instead of an uint16 * or vice versa, but that doesn't seem to be the case here for SamplesPerPixel.
Gerben Vos.