Main Content

writeDirectory

Create new IFD and make it current IFD

Description

writeDirectory(t) creates a new image file directory (IFD) and makes it the current IFD.

example

Examples

collapse all

Create a new TIFF file and add two new IFDs to the file.

Create a Tiff object for a new file.

t = Tiff('myfile.tif','w');

Add a new IFD to the file and display the current directory number. You can use this new IFD to add image data and tags to the TIFF file.

writeDirectory(t);
currentDirectory(t)
ans = 
1

Add another IFD to the file and display the current directory number. You can use this IFD to save an additional image to the same TIFF file.

writeDirectory(t);
currentDirectory(t)
ans = 
2

Close the Tiff object.

close(t);

Input Arguments

collapse all

Tiff object representing a TIFF file. Use the Tiff function to create the object.

Tips

  • You do not need this function when creating TIFF files that contain only one image.

Algorithms

collapse all

References

This function corresponds to the TIFFWriteDirectory function in the LibTIFF C API. To use this function, you must be familiar with the TIFF specification and technical notes. View this documentation at LibTIFF - TIFF Library and Utilities.

Version History

Introduced in R2009b