Main Content

rewriteDirectory

Write modified metadata to existing IFD

Description

example

rewriteDirectory(t) writes modified metadata (tag) data to an existing directory. Use this function when you want to change the value of a tag in an existing image file directory.

Examples

collapse all

Create image data, write it to a TIFF file, and modify the value of a tag.

Write a sample TIFF file, mytif.tif and create a Tiff object associated with this file.

imdata = peaks(256);
imwrite(imdata,'mytif.tif');
t = Tiff('mytif.tif','r+');

Modify the value of a tag.

setTag(t,'Software','MATLAB');
rewriteDirectory(t);
close(t);

Input Arguments

collapse all

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

Algorithms

collapse all

References

This function corresponds to the TIFFRewriteDirectory 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.

Introduced in R2009b