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
256
for theImageWidth
tag defined by the TIFF specificationField of the
Tiff.TagID
structureTiff.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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)