---
title: "Modify EXIF metadata in JPG, PNG, TIFF, more | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/editor/metadata-exif/"
md_url: "https://www.nutrient.io/guides/dotnet/editor/metadata-exif.md"
last_updated: "2026-05-21T17:12:02.203Z"
description: "Learn how to read and edit EXIF, XMP, and IPTC metadata in PDFs using C#. Comprehensive guides with practical examples included."
---

# Modify EXIF metadata using C#

### EXIF Tags

[EXIF Tags](https://www.nutrient.io/guides/dotnet/editor/metadata-exif.md)

### Page Labels

[Page Labels](https://www.nutrient.io/guides/dotnet/editor/metadata-pdf-page-label.md)

### XMP

[XMP](https://www.nutrient.io/guides/dotnet/editor/metadata-xmp.md)

### IPTC

[IPTC](https://www.nutrient.io/guides/dotnet/editor/metadata-iptc.md)

EXIF (Exchangeable Image File Format) is a standard used by digital cameras that specifies metadata tags such as camera settings, image metrics, date and time information, and more.

## Supported image formats

- JPEG (read and write)

- PNG (read and write)

- RAW (read only)

- TIFF (read and write)

- WebP (read and write)

## GPS tags

GPS tags are used by digital cameras that contain positioning information. They’re specified by the same standard as EXIF tags. This means that all methods described below are also applicable for GPS tags, but only for the following image formats:

- JPEG (read and write)

- TIFF (read and write)

## Getting EXIF tags

To retrieve EXIF tag data, use the following methods:

- [`TagGetID`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~TagGetID.html)

- [`TagGetType`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~TagGetType.html)

- [`TagGetName`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~TagGetName.html)

- [`TagGetValueString`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~TagGetValueString.html)

- [`TagGetValueBytes`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~TagGetValueBytes.html)

All the methods listed above require the image ID and the EXIF tag number.

The tag number may be different for every EXIF tag. This means that to get the exact EXIF tag you want, you have to loop through all tags. To get the total number of EXIF tags, use the [`TagCount` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~TagCount.html).

The code below shows how to list the EXIF tags of an image file:

### C#

```csharp

using GdPictureImaging gdpictureImaging = new GdPictureImaging();
int imageID = gdpictureImaging.CreateGdPictureImageFromFile(@"C:\temp\source.jpg");
// Create a `StringBuilder` object to store tags.
StringBuilder report = new StringBuilder();
// Get tag count.
int tagCount = gdpictureImaging.TagCount(imageID);
for (int i = 1; i <= tagCount; i++)
{
    // Get tag ID.
    Tags tagID = gdpictureImaging.TagGetID(imageID, i);
    //Get tag type.
    TagType tagType = gdpictureImaging.TagGetType(imageID, i);
    // Get tag name.
    string tagName = gdpictureImaging.TagGetName(imageID, i);
    // Get tag value.
    string tagValue = gdpictureImaging.TagGetValueString(imageID, i);
    // Append tag data.
    report.AppendLine($"{tagID} {tagType} {tagName} {tagValue}");
}
Console.WriteLine($"{report}");
GdPictureDocumentUtilities.DisposeImage(imageID);

```

### VB.NET

```vb

Using gdpictureImaging As GdPictureImaging = New GdPictureImaging()
    Dim imageID As Integer = gdpictureImaging.CreateGdPictureImageFromFile("C:\temp\source.jpg")
    ' Create a `StringBuilder` object to store tags.
    Dim report As StringBuilder = New StringBuilder()
    ' Get tag count.
    Dim tagCount As Integer = gdpictureImaging.TagCount(imageID)

    For i = 1 To tagCount
        ' Get tag ID.
        Dim tagID As Tags = gdpictureImaging.TagGetID(imageID, i)
        ' Get tag type.
        Dim tagType As TagType = gdpictureImaging.TagGetType(imageID, i)
        ' Get tag name.
        Dim tagName As String = gdpictureImaging.TagGetName(imageID, i)
        ' Get tag value.
        Dim tagValue As String = gdpictureImaging.TagGetValueString(imageID, i)
        ' Append tag data.
        report.AppendLine($"{tagID} {tagType} {tagName} {tagValue}")
    Next

    Console.WriteLine($"{report}")
    GdPictureDocumentUtilities.DisposeImage(imageID)
End Using

```

#### Used methods

- [`CreateGdPictureImageFromFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~CreateGdPictureImageFromFile.html)

- [`DisposeImage`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentUtilities~DisposeImage.html)

- [`TagCount`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~TagCount.html)

- [`TagGetID`]

- [`TagGetName`]

- [`TagGetValueString`]

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

## Setting an EXIF tag

To set an EXIF tag, use one of the following methods:

- [`TagSetValueString`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~TagSetValueString.html) — For tags containing a string value.

- [`TagSetValueByte`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~TagSetValueBytes.html) — For tags containing a byte value.

Both methods require the following parameters:

- `imageID` — Image ID.

- `TagID` — Tag ID, which is a member of the [`Tags` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.Tags.html).

- `TagType` — Tag type, which is a member of the [`TagType` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.TagType.html).

- `TagData` — The new value of the tag. It can be either a string or a byte value, depending on which method you use.

The code below shows how to modify an EXIF tag of an image file that specifies the date on which the image was taken:

### C#

```csharp

using GdPictureImaging gdPictureImaging = new GdPictureImaging();
int imageID = gdPictureImaging.CreateGdPictureImageFromFile(@"C:\temp\source.jpg");
// Get tag count.
int tagCount = gdPictureImaging.TagCount(imageID);
gdPictureImaging.TagSetValueString(imageID, Tags.TagExifDTOrig,
    TagType.TagTypeASCII, "2020:11:30 13:45:29");
// Save the image in a new file.
gdPictureImaging.SaveAsJPEG(imageID, @"C:\temp\output.jpg");
gdPictureImaging.ReleaseGdPictureImage(imageID);

```

### VB.NET

```vb

Using gdpictureImaging As GdPictureImaging = New GdPictureImaging()
    Dim imageID As Integer = gdPictureImaging.CreateGdPictureImageFromFile("C:\temp\source.jpg")
    ' Get tag count.
    Dim tagCount As Integer = gdPictureImaging.TagCount(imageID)
    gdPictureImaging.TagSetValueString(imageID, Tags.TagExifDTOrig,
        TagType.TagTypeASCII, "2020:11:30 13:45:29")
    ' Save the image in a new file.
    gdPictureImaging.SaveAsJPEG(imageID, "C:\temp\output.jpg")
    gdPictureImaging.ReleaseGdPictureImage(imageID)
End Using

```

#### Used methods

- [`CreateGdPictureImageFromFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~CreateGdPictureImageFromFile.html)

- [`DisposeImage`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureDocumentUtilities~DisposeImage.html)

- [`TagCount`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~TagCount.html)

- [`TagGetID`]

- [`TagSetValueString`]

- [`SaveAsJPEG`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~SaveAsJPEG.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)
---

## Related pages

- [Add an image to a PDF using C#](/guides/dotnet/editor/add-image-to-pdf.md)
- [Add a page to a PDF or a TIFF image in C# .NET](/guides/dotnet/editor/add-page.md)
- [Add text to an image using C#](/guides/dotnet/editor/add-text-to-image.md)
- [Attach a file to a PDF in C#](/guides/dotnet/editor/attach-a-file.md)
- [PDF and image editor in C#.NET](/guides/dotnet/editor.md)
- [Add text to PDFs in C#](/guides/dotnet/editor/add-text-to-pdf.md)
- [Add an image to another image using C#](/guides/dotnet/editor/add-image-to-image.md)
- [Merge PDFs in C#](/guides/dotnet/editor/merge-or-combine.md)
- [Edit IPTC metadata using C#](/guides/dotnet/editor/metadata-iptc.md)
- [Read and edit PDF page label metadata using C#](/guides/dotnet/editor/metadata-pdf-page-label.md)
- [Read and edit PDF XMP metadata using C#](/guides/dotnet/editor/metadata-xmp.md)
- [Split PDF pages into multiple pages in C#](/guides/dotnet/editor/split.md)
- [Add watermarks to PDFs and images in C#](/guides/dotnet/editor/watermark.md)

