C# TIFF Image Library
Edit TIFF Metadata in C#.NET


Allow Users to Read and Edit Metadata Stored in Tiff Image in C#.NET Application





C# Overview - View and Edit TIFF Metadata



RasterEdge .NET SDKs are built to enhance your productivity and streamline workflows. Our .NET SDKs own the most advanced & comprehensive documents and images reading and processing technologies. Among these SDKs, XDoc.Tiff for .NET has a mature imaging utility which allows Tiff image file metadata to be accessed and manipulated. In details, C# developers can integrate these Tiff file metadata manipulating features into a broad range of C#.NET projects, including reading, writing, deleting, and updating metadata. This Tiff metadata editing component supports the following metadata types.



  • EXIF tags
  • IIM (IPTC)
  • XMP data
  • Tiff tags


"Tiff Tag" refers to metadata information that is stored and saved with a Tiff document file. Tiff tag may contains information like color, size, count and value in captured Tiff image. In the following sections, you will get some C# sample codes for manipulating Tiff image metadata.



How to Get TIFF XMP Metadata in C#.NET



Use this C# sample code to get Tiff image Xmp metadata for string.



// Load your target Tiff docuemnt.
TIFFDocument doc = new TIFFDocument(@"c:\demo1.tif");

// Get Xmp metadata for string. And later, you may remove, add or update metadata.
String xmpMetadata = doc.GetXMPMetadata(0);


How to Get TIFF EXIF Metadata in C#.NET



You can get Exif tag of Tiff image by using the following sample code.



// Load your target Tiff document.
TIFFDocument doc = new TIFFDocument(@"C:\demo1.tif");

// Get the first page of Tiff document.
TIFFPage page = (TIFFPage)doc.GetPage(0);

// Get Tiff tag collection.
TagCollection collection = doc.GetTagCollection(0);

// Get Exif metadata. You can also update, remove, and add metadata.
List<EXIFField> exifMetadata = collection.ExifFields;


How to Get TIFF IPTC Metadata in C#.NET



This example is used for getting IPTC metadata in your C# program.



// Load your target Tiff document.
TIFFDocument doc = new TIFFDocument(@"C:\demo1.tif");
if (null == doc)
        throw new Exception("Fail to construct TIFF Document");

// Get Tiff tag collection.
TagCollection collection = doc.GetTagCollection(0);

// Get IPTC metadata. You can also update, remove, and add metadata.
List<IPTCField> IPTCMetadata = collection.IptcFields;

public TagCollection GetTagCollection(int pageIdx)

Description:
Get the specified page’s exif , iptc and tiff tag information.

Parameters:

Return:
Null if failed.


public String GetXMPMetadata(int pageIdx)

Description:
Get the specified page’s xmp information.

Parameters:

Return:
Null if failed.









Common Asked Questions

Does TIFF have metadata?

TIFF file contains tags which hold information about the tiff document and pages information, such as image dimensions, color space, and compressions. Using RasterEdge XDoc.TIFF C# library, you can read, view, add, edit, remove metadata from a TIFF file in your ASP.NET Core, MVC web and Windows apps.

How to view TIFF metadata?

You can view a TIFF file metadata information using free online service or installed photo software. You can also read, view, explore a TIFF file metadata using C# TIFF library in Visual Studio .NET IDE.

What is metadata in IPTC?

IPTC photo metadata provides data about photographs that can be processed by software. It is a standard set of data fields for embedding information about an image, such as the photographer's name, copyright, and location. Using TIFF C# SDK, you can also add, read, view, edit, delete IPTC metadata from a TIFF file in C# application.

How to read a TIFF file IPTC metadata?

You can use online free tools, installed photo software to read, view IPTC metadata from a TIFF file. Using C# TIFF component, you can add, read, view IPTC metadata from a TIFF document in C# projects.

What is the difference between EXIF and IPTC?

EXIF (Exchangeable Image Format), is used for storing a variety of information. It includes the recording date and time by digital cameras when a photo is taken. The IPTC stands for International Press Telecommunications Council. It is mainly used to contain a title, description, keywords, photographer's information, and copyright. C# TIFF library supports both TIFF EXIF and IPTC metadata editing in C# ASP.NET web applications.

What are TIFF tags?

TIFF tags are numerical identifiers that store metadata and image data within a TIFF file, providing information like image width (256) and height (257), color depth (258), compression (259).

How big is a TIFF tag?

A classic TIFF tag entry is 12 bytes long, including
  • 2-byte tag identifier
  • 2-byte type
  • 4-byte count
  • 4-byte value or offset

How do I view TIFF XMP metadata?

You can view TIFF XMP metadata using online free tools, installed tiff photo software on your desktop. In your C# ASP.NET, Windows project, you can read XMP metadata information from TIFF file using method TIFFDocument.GetXMPMetadata() in XDoc.TIFF C# library