1
<!-- Creator : groff version 1.18.1 -->
2
<!-- CreationDate: Fri Jul 13 17:43:17 2007 -->
5
<meta name="generator" content="groff -Thtml, see www.gnu.org">
6
<meta name="Content-Style" content="text/css">
7
<title>TIFFWriteDirectory</title>
11
<h1 align=center>TIFFWriteDirectory</h1>
12
<a href="#NAME">NAME</a><br>
13
<a href="#SYNOPSIS">SYNOPSIS</a><br>
14
<a href="#DESCRIPTION">DESCRIPTION</a><br>
15
<a href="#RETURN VALUES">RETURN VALUES</a><br>
16
<a href="#DIAGNOSTICS">DIAGNOSTICS</a><br>
17
<a href="#SEE ALSO">SEE ALSO</a><br>
23
<table width="100%" border=0 rules="none" frame="void"
24
cols="2" cellspacing="0" cellpadding="0">
25
<tr valign="top" align="left">
28
<p>TIFFWriteDirectory, TIFFRewriteDirectory,
29
TIFFCheckpointDirectory − write the current directory
30
in an open <small>TIFF</small> file</p>
33
<a name="SYNOPSIS"></a>
36
<table width="100%" border=0 rules="none" frame="void"
37
cols="2" cellspacing="0" cellpadding="0">
38
<tr valign="top" align="left">
41
<p><b>#include <tiffio.h></b></p>
43
<p><b>int TIFFWriteDirectory(TIFF *</b><i>tif</i><b>)<br>
44
int TIFFRewriteDirectory(TIFF *</b><i>tif</i><b>)<br>
45
int TIFFCheckpointDirectory(TIFF *</b><i>tif</i><b>)</b></p>
48
<a name="DESCRIPTION"></a>
51
<table width="100%" border=0 rules="none" frame="void"
52
cols="2" cellspacing="0" cellpadding="0">
53
<tr valign="top" align="left">
56
<p><i>TIFFWriteDirectory</i> will write the contents of the
57
current directory to the file and setup to create a new
58
subfile in the same file. Applications only need to call
59
<i>TIFFWriteDirectory</i> when writing multiple subfiles to
60
a single <small>TIFF</small> file. <i>TIFFWriteDirectory</i>
61
is automatically called by <i>TIFFClose</i> and
62
<i>TIFFFlush</i> to write a modified directory if the file
63
is open for writing.</p>
65
<p>The <i>TIFFRewriteDirectory</i> function operates
66
similarly to <i>TIFFWriteDirectory,</i> but can be called
67
with directories previously read or written that already
68
have an established location in the file. It will rewrite
69
the directory, but instead of place it at it’s old
70
location (as <i>TIFFWriteDirectory</i> would) it will place
71
them at the end of the file, correcting the pointer from the
72
preceeding directory or file header to point to it’s
73
new location. This is particularly important in cases where
74
the size of the directory and pointed to data has grown, so
75
it won’t fit in the space available at the old
78
<p>The <i>TIFFCheckpointDirectory</i> writes the current
79
state of the tiff directory into the file to make what is
80
currently in the file readable. Unlike
81
<i>TIFFWriteDirectory, TIFFCheckpointDirectory</i> does not
82
free up the directory data structures in memory, so they can
83
be updated (as strips/tiles are written) and written again.
84
Reading such a partial file you will at worst get a tiff
85
read error for the first strip/tile encountered that is
86
incomplete, but you will at least get all the valid data in
87
the file before that. When the file is complete, just use
88
<i>TIFFWriteDirectory</i> as usual to finish it off
92
<a name="RETURN VALUES"></a>
93
<h2>RETURN VALUES</h2>
95
<table width="100%" border=0 rules="none" frame="void"
96
cols="2" cellspacing="0" cellpadding="0">
97
<tr valign="top" align="left">
100
<p>1 is returned when the contents are successfully written
101
to the file. Otherwise, 0 is returned if an error was
102
encountered when writing the directory contents.</p>
105
<a name="DIAGNOSTICS"></a>
108
<table width="100%" border=0 rules="none" frame="void"
109
cols="2" cellspacing="0" cellpadding="0">
110
<tr valign="top" align="left">
113
<p>All error messages are directed to the
114
<i>TIFFError</i>(3TIFF) routine.</p>
116
<p><b>Error post-encoding before directory write</b>. Before
117
writing the contents of the current directory, any pending
118
data are flushed. This message indicates that an error
119
occurred while doing this.</p>
121
<p><b>Error flushing data before directory write</b>. Before
122
writing the contents of the current directory, any pending
123
data are flushed. This message indicates that an error
124
occurred while doing this.</p>
126
<p><b>Cannot write directory, out of space</b>. There was
127
not enough space to allocate a temporary area for the
128
directory that was to be written.</p>
130
<p><b>Error writing directory count</b>. A write error
131
occurred when writing the count of fields in the
134
<p><b>Error writing directory contents</b>. A write error
135
occurred when writing the directory fields.</p>
137
<p><b>Error writing directory link</b>. A write error
138
occurred when writing the link to the next directory.</p>
140
<p><b>Error writing data for field "%s"</b>. A
141
write error occurred when writing indirect data for the
144
<p><b>Error writing TIFF header</b>. A write error occurred
145
when re-writing header at the front of the file.</p>
147
<p><b>Error fetching directory count</b>. A read error
148
occurred when fetching the directory count field for a
149
previous directory. This can occur when setting up a link to
150
the directory that is being written.</p>
152
<p><b>Error fetching directory link</b>. A read error
153
occurred when fetching the directory link field for a
154
previous directory. This can occur when setting up a link to
155
the directory that is being written.</p>
158
<a name="SEE ALSO"></a>
161
<table width="100%" border=0 rules="none" frame="void"
162
cols="2" cellspacing="0" cellpadding="0">
163
<tr valign="top" align="left">
166
<p><b>TIFFOpen</b>(3TIFF), <b>TIFFError</b>(3TIFF),
167
<b>TIFFReadDirectory</b>(3TIFF),
168
<b>TIFFSetDirectory</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
170
<p>Libtiff library home page:
171
<b>http://www.remotesensing.org/libtiff/</b></p>