Working with metadata in GIF images

Detecting the GIF version

The following sample of code will help you to detect the version of a loaded GIF image and extract some additional file format information.

  1. Load a GIF image
  2. Extract the root metadata package
  3. Use the FileType property to obtain file format information

AdvancedUsage.ManagingMetadataForSpecificFormats.Image.Gif.GifReadFileFormatProperties

using (Metadata metadata = new Metadata(Constants.InputGif))
{
	var root = metadata.GetRootPackage<GifRootPackage>();

	Console.WriteLine(root.FileType.FileFormat);
	Console.WriteLine(root.FileType.Version);
	Console.WriteLine(root.FileType.ByteOrder);
	Console.WriteLine(root.FileType.MimeType);
	Console.WriteLine(root.FileType.Extension);
	Console.WriteLine(root.FileType.Width);
	Console.WriteLine(root.FileType.Height);
}

Working with XMP Metadata

GroupDocs.Metadata for .NET also allows managing XMP metadata in GIF files. For more details please refer to the following guide: Working with XMP metadata.

More resources

GitHub examples

You may easily run the code above and see the feature in action in our GitHub examples:

GIF metadata management demo App

The GIF Metadata Editing app is available to view and edit metadata of GIF images, including XMP properties and image details.

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.