getTag
Value of specified tag
Description
Examples
Open a TIFF file and get the value of its tags in multiple ways.
Create a Tiff object for the file.
t = Tiff('example.tif','r');
Get the tag value for the ImageWidth tag by specifying the tag by its name.
tagval = getTag(t,'ImageWidth')tagval = 600
Alternatively, specify the tag by its numeric identifier.
tagval1 = getTag(t,256)
tagval1 = 600
Another way to specify the tag is to use the Tiff.TagID structure. The names of the fields of the Tiff.TagID structure are valid tag names that contain the corresponding tag numeric identifiers. For instance the field Tiff.TagID.ImageWidth contains the value 256.
tagval2 = getTag(t,Tiff.TagID.ImageWidth)
tagval2 = 600
Close the Tiff object.
close(t);
Input Arguments
Tiff object representing a TIFF file. Use the Tiff function to create the object.
Tag ID of a Tiff object, specified as a character vector or string scalar,
or a numeric identifier.
For example, you can specify tagId for the ImageWidth
tag as any of these:
Character vector or string scalar containing the tag name
'ImageWidth'Numeric identifier
256for theImageWidthtag defined by the TIFF specificationField of the
Tiff.TagIDstructureTiff.TagID.ImageWidth.
The names of the fields of the Tiff.TagID structure are valid tag
names that contain the corresponding tag numeric identifiers. For instance, the field
Tiff.TagID.ImageWidth contains the value 256.
To see a list of all the tags along with their numeric identifiers, type
Tiff.TagID in the command window.
Example: 'ImageWidth'
Example: 256
Example: Tiff.TagID.ImageWidth
Data Types: double | char | string
Algorithms
This function corresponds to the TIFFGetField 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
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)