2004.12.08 02:35 "[Tiff] Q: writing tiled TIFFs", by Chris Losinger

2004.12.10 21:47 "Re: [Tiff] Q: writing tiled TIFFs", by Andrey Kiselev

256x256 is apparently the LibTiff default. why does LibTiff choose that for a 200x200 image? i don't know.

How do you arrive at this 'LibTiff default'?

         // set image dims
      TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, (uint32) nWidth);
      TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, (uint32) nHeight);

         // get default tile size
       uint32 tilewidth, tileheight;
       tilewidth = 0;
       tileheight = 0;
       TIFFDefaultTileSize(tiff, &tilewidth, &tileheight);

         // use that size
       TIFFSetField(tiff, TIFFTAG_TILEWIDTH, tilewidth);
       TIFFSetField(tiff, TIFFTAG_TILELENGTH, tileheight);

libtiff uses 256x256 tiles by default, but specification does not define any default value for this tag, so it is better to set this values manually. I can add logic to limit the tile size by the image dimensions, but I'm not sure it is necessary.

Andrey

Andrey V. Kiselev
Home phone: +7 812 5970603 ICQ# 26871517