AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
October 2004

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2004.10.25 12:27 "read 5 bands geotiff image", by Zheng Hu
2004.10.25 12:53 "Re: read 5 bands geotiff image", by Frank Warmerdam

2004.10.25 12:27 "read 5 bands geotiff image", by Zheng Hu

Hi,

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??