title: Is it possible to process a full tiled tiff image by saving only one tile in memory every time?
body: <p>I'am having a simple issue. I process tiff images that are enormous (>4GB), and when loading all of them in memory i fill my RAM and the program is killed. I tried to save them as tiled tiffs and then use libtiff to load them tile-by-tile like this:</p>
  
  <pre><code>tdata_t buf = _TIFFmalloc(TIFFTileSize(tifSrc));
  for(int i = 0;i&lt; 20000;i+=128){
          for(int j = 0;j&lt; 20000;j+=128)
          {
                  TIFFReadTile(tifSrc, buf , i, j, 0,0);
                  TIFFWriteTile(tifDst, (tdata_t)buf , i, j,0, 0);
          }
  }
  _TIFFfree(buf);
  </code></pre>
  
  <p>But althought i expected the above code to load in memory only one tile per iteration (128x128 bytes), the whole image is stored instead...
  Does anybody know how can i load only one tile in memory?</p>