1<!-- Creator : groff version 1.19.2 --> 2<!-- CreationDate: Mon Jan 2 17:41:47 2006 --> 3<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 4"http://www.w3.org/TR/html4/loose.dtd"> 5<html> 6<head> 7<meta name="generator" content="groff -Thtml, see www.gnu.org"> 8<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> 9<meta name="Content-Style" content="text/css"> 10<style type="text/css"> 11 p { margin-top: 0; margin-bottom: 0; } 12 pre { margin-top: 0; margin-bottom: 0; } 13 table { margin-top: 0; margin-bottom: 0; } 14</style> 15<title>TIFFWriteDirectory</title> 16 17</head> 18<body> 19 20<h1 align=center>TIFFWriteDirectory</h1> 21 22<a href="#NAME">NAME</a><br> 23<a href="#SYNOPSIS">SYNOPSIS</a><br> 24<a href="#DESCRIPTION">DESCRIPTION</a><br> 25<a href="#RETURN VALUES">RETURN VALUES</a><br> 26<a href="#DIAGNOSTICS">DIAGNOSTICS</a><br> 27<a href="#SEE ALSO">SEE ALSO</a><br> 28 29<hr> 30 31 32<a name="NAME"></a> 33<h2>NAME</h2> 34 35 36 37<p style="margin-left:11%; margin-top: 1em">TIFFWriteDirectory, 38TIFFRewriteDirectory, TIFFCheckpointDirectory − write 39the current directory in an open <small>TIFF</small> 40file</p> 41 42<a name="SYNOPSIS"></a> 43<h2>SYNOPSIS</h2> 44 45 46<p style="margin-left:11%; margin-top: 1em"><b>#include 47<tiffio.h></b></p> 48 49<p style="margin-left:11%; margin-top: 1em"><b>int 50TIFFWriteDirectory(TIFF *</b><i>tif</i><b>) <br> 51int TIFFRewriteDirectory(TIFF *</b><i>tif</i><b>) <br> 52int TIFFCheckpointDirectory(TIFF *</b><i>tif</i><b>)</b></p> 53 54<a name="DESCRIPTION"></a> 55<h2>DESCRIPTION</h2> 56 57 58 59<p style="margin-left:11%; margin-top: 1em"><i>TIFFWriteDirectory</i> 60will write the contents of the current directory to the file 61and setup to create a new subfile in the same file. 62Applications only need to call <i>TIFFWriteDirectory</i> 63when writing multiple subfiles to a single 64<small>TIFF</small> file. <i>TIFFWriteDirectory</i> is 65automatically called by <i>TIFFClose</i> and 66<i>TIFFFlush</i> to write a modified directory if the file 67is open for writing.</p> 68 69<p style="margin-left:11%; margin-top: 1em">The 70<i>TIFFRewriteDirectory</i> function operates similarly to 71<i>TIFFWriteDirectory,</i> but can be called with 72directories previously read or written that already have an 73established location in the file. It will rewrite the 74directory, but instead of place it at it’s old 75location (as <i>TIFFWriteDirectory</i> would) it will place 76them at the end of the file, correcting the pointer from the 77preceeding directory or file header to point to it’s 78new location. This is particularly important in cases where 79the size of the directory and pointed to data has grown, so 80it won’t fit in the space available at the old 81location.</p> 82 83<p style="margin-left:11%; margin-top: 1em">The 84<i>TIFFCheckpointDirectory</i> writes the current state of 85the tiff directory into the file to make what is currently 86in the file readable. Unlike <i>TIFFWriteDirectory, 87TIFFCheckpointDirectory</i> does not free up the directory 88data structures in memory, so they can be updated (as 89strips/tiles are written) and written again. Reading such a 90partial file you will at worst get a tiff read error for the 91first strip/tile encountered that is incomplete, but you 92will at least get all the valid data in the file before 93that. When the file is complete, just use 94<i>TIFFWriteDirectory</i> as usual to finish it off 95cleanly.</p> 96 97<a name="RETURN VALUES"></a> 98<h2>RETURN VALUES</h2> 99 100 101<p style="margin-left:11%; margin-top: 1em">1 is returned 102when the contents are successfully written to the file. 103Otherwise, 0 is returned if an error was encountered when 104writing the directory contents.</p> 105 106<a name="DIAGNOSTICS"></a> 107<h2>DIAGNOSTICS</h2> 108 109 110<p style="margin-left:11%; margin-top: 1em">All error 111messages are directed to the <i>TIFFError</i>(3TIFF) 112routine.</p> 113 114<p style="margin-left:11%; margin-top: 1em"><b>Error 115post-encoding before directory write</b>. Before writing the 116contents of the current directory, any pending data are 117flushed. This message indicates that an error occurred while 118doing this.</p> 119 120<p style="margin-left:11%; margin-top: 1em"><b>Error 121flushing data before directory write</b>. Before writing the 122contents of the current directory, any pending data are 123flushed. This message indicates that an error occurred while 124doing this.</p> 125 126<p style="margin-left:11%; margin-top: 1em"><b>Cannot write 127directory, out of space</b>. There was not enough space to 128allocate a temporary area for the directory that was to be 129written.</p> 130 131<p style="margin-left:11%; margin-top: 1em"><b>Error 132writing directory count</b>. A write error occurred when 133writing the count of fields in the directory.</p> 134 135<p style="margin-left:11%; margin-top: 1em"><b>Error 136writing directory contents</b>. A write error occurred when 137writing the directory fields.</p> 138 139<p style="margin-left:11%; margin-top: 1em"><b>Error 140writing directory link</b>. A write error occurred when 141writing the link to the next directory.</p> 142 143<p style="margin-left:11%; margin-top: 1em"><b>Error 144writing data for field "%s"</b>. A write error 145occurred when writing indirect data for the specified 146field.</p> 147 148<p style="margin-left:11%; margin-top: 1em"><b>Error 149writing TIFF header</b>. A write error occurred when 150re-writing header at the front of the file.</p> 151 152<p style="margin-left:11%; margin-top: 1em"><b>Error 153fetching directory count</b>. A read error occurred when 154fetching the directory count field for a previous directory. 155This can occur when setting up a link to the directory that 156is being written.</p> 157 158<p style="margin-left:11%; margin-top: 1em"><b>Error 159fetching directory link</b>. A read error occurred when 160fetching the directory link field for a previous directory. 161This can occur when setting up a link to the directory that 162is being written.</p> 163 164<a name="SEE ALSO"></a> 165<h2>SEE ALSO</h2> 166 167 168 169<p style="margin-left:11%; margin-top: 1em"><b>TIFFOpen</b>(3TIFF), 170<b>TIFFError</b>(3TIFF), <b>TIFFReadDirectory</b>(3TIFF), 171<b>TIFFSetDirectory</b>(3TIFF), <b>libtiff</b>(3TIFF)</p> 172 173<p style="margin-left:11%; margin-top: 1em">Libtiff library 174home page: <b>http://www.remotesensing.org/libtiff/</b></p> 175<hr> 176</body> 177</html> 178