1. Products
  2.   Image
  3.   .NET
  4.   MetadataExtractor
 
  

Open Source .NET API for Images

.NET Library for Reading Metadata from Images

MetadataExtractor is a simple .NET API for extracting metadata form Images. Using the API, you can extract wide range of metadata information including Exif, IPTC, XMP, JFIF/JFXX, ICC Profiles, WebP properties, Netpbm properties, PNG properties, BMP properties, GIF properties, ICO properties, and PCX properties.

The API supports various images file formats and camera raw images and allows getting camera-specific makernote data for large range of camera manufactures.

Previous Next

Getting Started with MetadataExtractor

The recommended way to install MetadataExtractor is via NuGet. Please use the following command to install MetadataExtractor.

Install-Package MetadataExtractor

Read & Write Images Metadata via .NET

he MetadataExtractor API allows software developers to access and load images inside their .NET applications. The API helps developers to identify the file type they are processing automatically from the first bytes of the file. Generally, the ImageMetadataReader class can be used to read the metadata of an image file. There are more specific readers also available if you know type of file you're reading from such as JpegMetadataReader. But it is always recommended to use ImageMetadataReader as it is safer.

Read Images Metadata via C#.NET


    Metadata metadata = ImageMetadataReader.readMetadata(file);

    for (Directory directory : metadata.getDirectories()) {
        for (Tag tag : directory.getTags()) {
            System.out.format("[%s] - %s = %s",
                directory.getName(), tag.getTagName(), tag.getDescription());
        }
        if (directory.hasErrors()) {
            for (String error : directory.getErrors()) {
                System.err.format("ERROR: %s", error);
            }
        }
    }

Extract Metadata from Images using C#

MetadataExtractor allows extracting wide range of metadata information from images. You can extract all information in image by looping directories and then by looping throught each tag in it. Directory contains metadata type informtion and tag includes the properties. You can extract specific information from images using directories.OfType().FirstOrDefault() method.

Decoded Description of a Specific Tag via C#


    Metadata metadata = ImageMetadataReader.readMetadata(file);

    for (Directory directory : metadata.getDirectories()) {
        for (Tag tag : directory.getTags()) {
            System.out.format("[%s] - %s = %s",
                directory.getName(), tag.getTagName(), tag.getDescription());
        }
        if (directory.hasErrors()) {
            for (String error : directory.getErrors()) {
                System.err.format("ERROR: %s", error);
            }
        }
    }

Extract Camera Specific Maker Notes using C#

The Open Source image processing API MetadataExtractor allows extracting camera-specific makernote for cameras manufactured Canon, Apple, Agfa, Casio, DJI, Epson, Fujifilm, Kodak, Kyocera, Leica, Minolta, Nikon, Olympus, Panasonic, Pentax, Reconyx, Sanyo, Sigma/Foveon and Sony.

 English