AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2005.05.12 22:27 "[Tiff] Array of open TIFFs limited to 2045?", by S Smith
2005.05.12 22:33 "RE: [Tiff] Array of open TIFFs limited to 2045?", by Jason Frank
2005.05.12 22:42 "Re: [Tiff] Array of open TIFFs limited to 2045?", by Chris Cox
2005.05.12 23:14 "Re: [Tiff] Array of open TIFFs limited to 2045?", by Frank Warmerdam
2005.05.13 00:32 "Re: [Tiff] Array of open TIFFs limited to 2045?", by S Smith

2005.05.12 22:27 "[Tiff] Array of open TIFFs limited to 2045?", by S Smith

I have a continuous acquisition loop going and I want to save time by opening all the TIFF files beforehand and then closing them all at the end of the epoch. But there seems to be a limit of 2045 files (variable 'numfiles' below). Libtiff crashes if I exceed that number of files. Why? Is there a way around it?

TIFF** tifarray;
tifarray = (TIFF**)malloc(sizeof(TIFF*)*numfiles);
for (int prei=0;prei<m_NumFiles;prei++) {
        filename_suffix.Format("%06d.tif",prei);
        output_filename = m_FilenameBase + filename_suffix;
        tif = TIFFOpen(output_filename, "w");
        TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
        TIFFSetField(tif, TIFFTAG_IMAGELENGTH, 512);
        TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, 512);
        TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 16);
        TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1);
        TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
        tifarray[prei]=tif;
        str.Format("Now prewriting file: %i / %i", prei, m_NumFiles);
        pDataWritten->SetWindowText(str);
}