| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2004.10.25 12:27 "read 5 bands geotiff image", by Zheng HuHi,
I write a code to read my 5 bands geotiff image
unsigned char *buf;
float *test = &buf;
buf = _TIFFmalloc(scansize);
for (line = 0; line < 5; line++) //5 pixel
{
int i;
const char *sep = "";
//float *test = &buf;
//TIFFReadScanline(tif, test, line, 0);
fprintf(stdout, "%d:", line);
for (i = 0; i < 50; i++) // 50 length
{
int j;
TIFFReadScanline(tif, test, i, line);
fprintf(stdout, "%s", sep);
for (j = 0; j < 50; j++) // 50 width
{
fprintf(stdout, " %f", test[i * 50+ j]);
}
sep = ",";
}
fprintf(stdout, "\n");
}
When I run this code , I find variable i and line is overflow......
How can I do????Where is wrong??
|
|||||||