Return-Path: <tiff-bounces@remotesensing.org>
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx007.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id j4CMZKae003165
        for <joris.at.lebbeke@skynet.be>; Fri, 13 May 2005 00:35:21 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id AAE1F2543087; Thu, 12 May 2005 18:33:41 -0400 (EDT)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from mail.srcp.com (unknown [12.5.252.28])
	by xserve.flids.com (Postfix) with ESMTP id 8F0EE2543060
	for <tiff@remotesensing.org>; Thu, 12 May 2005 18:33:38 -0400 (EDT)
Received: from CORPDALLMSG05.na.srcp.net ([10.150.10.117] RDNS failed) by
	mail.srcp.com with Microsoft SMTPSVC(6.0.3790.211); 
	Thu, 12 May 2005 17:33:37 -0500
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Subject: RE: [Tiff] Array of open TIFFs limited to 2045?
Date: Thu, 12 May 2005 17:33:36 -0500
Message-ID: <741E24F735AED141B61948AC155E7DAA0E67C0@CORPDALLMSG05.na.srcp.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [Tiff] Array of open TIFFs limited to 2045?
Thread-Index: AcVXQe+SDl1sEZ/TT0aWMs/eFgIJxQAAHVMA
From: "Frank, Jason" <JasonFrank@srcp.com>
To: "S Smith" <slsmith0010@yahoo.com>, <tiff@remotesensing.org>
X-OriginalArrivalTime: 12 May 2005 22:33:37.0996 (UTC)
	FILETIME=[A3F270C0:01C55742]
Cc: 
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by inmx007.isp.belgacom.be id j4CMZKae003165
X-UIDL: 000000000023ceae.000001e0
X-MSP-STORE: Fri, 13 May 2005 00:35:25 --21-99
Status:   

I'd start with the difference between numfiles (in your malloc) and
m_NumFiles (in your for loop.)  If m_NumFiles is > than numfiles, you'll
probably be disappointed in the results.

Jason 

-----Original Message-----
From: tiff-bounces@remotesensing.org
[mailto:tiff-bounces@remotesensing.org] On Behalf Of S Smith
Sent: Thursday, May 12, 2005 5:27 PM
To: tiff@remotesensing.org
Subject: [Tiff] Array of open TIFFs limited to 2045?


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);
}

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com _______________________________________________
Tiff mailing list: Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
_______________________________________________
Tiff mailing list: Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/

