/* Similar to TIFFWriteDirectory(), writes the directory out but leaves all data structures in memory so that it can be written again. This will make a partially written TIFF file readable before it is successfully completed/closed.  */
int TIFFCheckpointDirectory(TIFF *tif)
/* Similar to TIFFWriteDirectory(), writes the directory out but leaves all data structures in memory so that it can be written again. This will make a partially written TIFF file readable before it is successfully completed/closed.  */
int TIFFCheckpointDirectory(TIFF *tif)
{
	int rc;
	if (tif->tif_dir.td_stripoffset == NULL)
	    (void) TIFFSetupStrips(tif);
	rc = TIFFWriteDirectorySec(tif,TRUE,FALSE,NULL);
	(void) TIFFSetWriteOffset(tif, TIFFSeekFile(tif, 0, SEEK_END));
	return rc;
}