1TIFFWriteDirectory(3TIFF)                            TIFFWriteDirectory(3TIFF)
2
3
4

NAME

6       TIFFWriteDirectory,   TIFFRewriteDirectory,  TIFFCheckpointDirectory  -
7       write the current directory in an open TIFF file
8

SYNOPSIS

10       #include <tiffio.h>
11
12       int TIFFWriteDirectory(TIFF *tif)
13       int TIFFRewriteDirectory(TIFF *tif)
14       int TIFFCheckpointDirectory(TIFF *tif)
15

DESCRIPTION

17       TIFFWriteDirectory will write the contents of the current directory  to
18       the  file  and setup to create a new subfile in the same file. Applica‐
19       tions only need to call TIFFWriteDirectory when writing  multiple  sub‐
20       files  to  a  single  TIFF  file.   TIFFWriteDirectory is automatically
21       called by TIFFClose and TIFFFlush to write a modified directory if  the
22       file is open for writing.
23
24       The TIFFRewriteDirectory function operates similarly to TIFFWriteDirec‐
25       tory, but can be called with directories  previously  read  or  written
26       that already have an established location in the file.  It will rewrite
27       the directory, but instead  of  place  it  at  it's  old  location  (as
28       TIFFWriteDirectory  would)  it  will place them at the end of the file,
29       correcting the pointer from the preceding directory or file  header  to
30       point  to  it's  new location.  This is particularly important in cases
31       where the size of the directory and pointed to data has  grown,  so  it
32       won't fit in the space available at the old location.
33
34       The TIFFCheckpointDirectory writes the current state of the tiff direc‐
35       tory into the file to make what is  currently  in  the  file  readable.
36       Unlike TIFFWriteDirectory, TIFFCheckpointDirectory does not free up the
37       directory data structures  in  memory,  so  they  can  be  updated  (as
38       strips/tiles  are  written)  and written again.  Reading such a partial
39       file you will at worst get a tiff read error for the  first  strip/tile
40       encountered that is incomplete, but you will at least get all the valid
41       data in the file before that.  When the  file  is  complete,  just  use
42       TIFFWriteDirectory as usual to finish it off cleanly.
43

RETURN VALUES

45       1  is  returned when the contents are successfully written to the file.
46       Otherwise, 0 is returned if an error was encountered when  writing  the
47       directory contents.
48

DIAGNOSTICS

50       All error messages are directed to the TIFFError(3TIFF) routine.
51
52       Error  post-encoding  before  directory write.  Before writing the con‐
53       tents of the current directory, any pending data are flushed. This mes‐
54       sage indicates that an error occurred while doing this.
55
56       Error  flushing  data  before directory write.  Before writing the con‐
57       tents of the current directory, any pending data are flushed. This mes‐
58       sage indicates that an error occurred while doing this.
59
60       Cannot  write  directory,  out of space.  There was not enough space to
61       allocate a temporary area for the directory that was to be written.
62
63       Error writing directory count.  A write error occurred when writing the
64       count of fields in the directory.
65
66       Error  writing directory contents.  A write error occurred when writing
67       the directory fields.
68
69       Error writing directory link.  A write error occurred when writing  the
70       link to the next directory.
71
72       Error writing data for field "%s".  A write error occurred when writing
73       indirect data for the specified field.
74
75       Error writing TIFF header.  A  write  error  occurred  when  re-writing
76       header at the front of the file.
77
78       Error  fetching  directory  count.  A read error occurred when fetching
79       the directory count field for a previous  directory.   This  can  occur
80       when setting up a link to the directory that is being written.
81
82       Error fetching directory link.  A read error occurred when fetching the
83       directory link field for a previous directory.   This  can  occur  when
84       setting up a link to the directory that is being written.
85

SEE ALSO

87       TIFFOpen(3TIFF), TIFFError(3TIFF), TIFFReadDirectory(3TIFF), TIFFSetDi‐
88       rectory(3TIFF), libtiff(3TIFF)
89
90       Libtiff library home page: http://www.simplesystems.org/libtiff/
91
92
93
94libtiff                       September 26, 2001     TIFFWriteDirectory(3TIFF)
Impressum