2002.10.30 13:05 "Read a tiff file and work with the file", by Stephan Schmidt

Hello everyone,

I wanna read a Tifffile and write a second File with some values of the first one. But in how get one pixel? And how set one pixel?

uint32 imagelength;
tdata_t buf1;
tdata_t buf2;
uint32 row;
buf1 = _TIFFmalloc(TIFFScanlineSize(tif1));
buf2 = _TIFFmalloc(TIFFScanlineSize(tif2));
row = 1;
TIFFReadScanline(tif1, buf1, row);

Now? What to do with the buf1? How can i get the value of the first pixel and so on? And how set the buf2 (with modified values)?

TIFFWriteScanline(tif2, buf2, row);

Or is there a better way to read, modify and write tiffiles? I tried TIFFReadRGBAImage but the _TIFFmalloc with height * width * sizeof (uint32) fails because the decompressedfile (1 bit) is to large.

TIA,

Stephan