MetadataExtractor 2.8.1

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package MetadataExtractor --version 2.8.1
NuGet\Install-Package MetadataExtractor -Version 2.8.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MetadataExtractor" Version="2.8.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MetadataExtractor --version 2.8.1
#r "nuget: MetadataExtractor, 2.8.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MetadataExtractor as a Cake Addin
#addin nuget:?package=MetadataExtractor&version=2.8.1

// Install MetadataExtractor as a Cake Tool
#tool nuget:?package=MetadataExtractor&version=2.8.1

metadata-extractor logo

Build Status MetadataExtractor NuGet version MetadataExtractor NuGet download count

MetadataExtractor is a straightforward .NET library for reading metadata from image, movie and audio files.

Installation

The easiest way to use this library is via its NuGet package.

Either add this to your project file

<ItemGroup>
    <PackageReference Include="MetadataExtractor" Version="2.8.1" />
</ItemGroup>

Or type this in Visual Studio's Package Manager Console:

PM> Install-Package MetadataExtractor

Or search for MetadataExtractor in the Visual Studio NuGet Package Manager.

Usage

IEnumerable<Directory> directories = ImageMetadataReader.ReadMetadata(imagePath);

The resulting directories sequence holds potentially many different directories of metadata, depending upon the input image.

To print out all values from all directories:

foreach (var directory in directories)
foreach (var tag in directory.Tags)
    Console.WriteLine($"{directory.Name} - {tag.Name} = {tag.Description}");

Producing:

Exif SubIFD - Exposure Time = 1/60 sec
Exif SubIFD - F-Number = f/8.0
...
Exif IFD0 - Make = NIKON CORPORATION
Exif IFD0 - Model = NIKON D70
...
IPTC - Credit = Drew Noakes
IPTC - City = London
...

Access a specific value, in this case the Exif DateTime tag:

var subIfdDirectory = directories.OfType<ExifSubIfdDirectory>().FirstOrDefault();
var dateTime = subIfdDirectory?.GetDescription(ExifDirectoryBase.TagDateTime);

Features

The library understands several formats of metadata, many of which may be present in a single image:

It supports various file types.

  • Images

    • BMP
    • EPS
    • GIF
    • HEIF / HEIC
    • ICO
    • JPEG / JFIF
    • Netpbm
    • PCX
    • PNG
    • PSD
    • TGA
    • TIFF / BigTIFF
    • WebP
    • Camera Raw
      • ARW (Sony)
      • CR2 (Canon)
      • NEF (Nikon)
      • ORF (Olympus)
      • RW2 (Panasonic)
      • RWL (Leica)
      • SRW (Samsung)
  • Movies

    • AVCI
    • AVI
    • MOV (QuickTime)
    • MP4
  • Audio

    • WAV
    • MP3

Camera-specific "makernote" data is decoded for cameras manufactured by:

  • Agfa
  • Apple
  • Canon
  • Casio
  • DJI
  • Epson
  • FLIR
  • Fujifilm
  • Kodak
  • Kyocera
  • Leica
  • Minolta
  • Nikon
  • Olympus
  • Panasonic
  • Pentax
  • Reconyx
  • Sanyo
  • Sigma/Foveon
  • Sony

Supported Frameworks

This library targets:

  • .NET Framework 3.5 (net35)
  • .NET Framework 4.5 (net45)
  • .NET Standard 1.3 (netstandard1.3)
  • .NET Standard 2.0 (netstandard2.0)

All target frameworks are provided via the one NuGet package.

net35 and net45 target the full .NET Framework. net45 uses the newer IReadOnlyList<> on some public APIs where net35 uses IList<>. Internally net45 also uses some newer library features for slightly improved performance.

netstandard1.3 implements version 1.3 of the .NET Standard which covers .NET Core, Mono, Xamarin platforms, UWP, and future platforms.

A PCL build was supported until version 1.5.3 which supported Silverlight 5.0, Windows 8.0, Windows Phone 8.1 and Windows Phone Silverlight 8.0. PCL versions did not support file-system metadata due to restricted IO APIs.

Building

Building this repo requires a recent version of Visual Studio 2022. Ensure you have the .NET Core Development Tools workload installed via the Visual Studio Installer.

The library itself, once built, may be consumed from projects in much earlier versions of Visual Studio.

Questions & Feedback

The quickest way to have your questions answered is via Stack Overflow. Check whether your question has already been asked, and if not, ask a new one tagged with both metadata-extractor and .net.

Bugs and feature requests should be provided via the project's issue tracker. Please attach sample images where possible as most issues cannot be investigated without an image.

Contributing

If you want to get your hands dirty, making a pull request is a great way to enhance the library. In general it's best to create an issue first that captures the problem you want to address. You can discuss your proposed solution in that issue. This gives others a chance to provide feedback before you spend your valuable time working on it.

An easier way to help is to contribute to the sample image file library used for research and testing.

Credits

This library is developed by Drew Noakes and contributors.

Thanks are due to the many users who sent in suggestions, bug reports, sample images from their cameras as well as encouragement. Wherever possible, they have been credited in the source code and commit logs.

This library was originally written in Java in 2002. In 2014, Yakov Danilov (for Imazen LLC) converted the code to C# using Sharpen. The code has subsequently been edited to provide a more idiomatic .NET API. Both projects are now developed in unison and aim to be functionally equivalent.

Other languages

  • Java metadata-extractor is the original implementation of this project, from which this .NET version was ported
  • PHP php-metadata-extractor wraps the Java project, making it available to users of PHP

More information about this project is available at:

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.3 is compatible.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net35 is compatible.  net40 was computed.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (20)

Showing the top 5 NuGet packages that depend on MetadataExtractor:

Package Downloads
FenixAlliance.ACL.Dependencies

Application Component for the Alliance Business Suite.

Apalla.Bubu.Shared

Bubu is application framework to easily build crossplatform applications. Apalla.Bubu.Shared contains general classes for all application types and platforms.

Wyam.Xmp The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Wyam is a simple to use, highly modular, and extremely configurable static content generator. This library provides support for analyzing XML metadata.

Dynamicweb.Imaging.Providers.MetadataExtractorProviders

MetadataExtractor providers for image metadata handling

DMISharp The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Library for handling BYOND DMI files.

GitHub repositories (9)

Showing the top 5 popular GitHub repositories that depend on MetadataExtractor:

Repository Stars
ElevenPaths/FOCA
Tool to find metadata and hidden information in the documents.
LykosAI/StabilityMatrix
Multi-Platform Package Manager for Stable Diffusion
Webreaper/Damselfly
Damselfly is a server-based Photograph Management app. The goal of Damselfly is to index an extremely large collection of images, and allow easy search and retrieval of those images, using metadata such as the IPTC keyword tags, as well as the folder and file names. Damselfly includes support for object/face detection.
n00mkrad/text2image-gui
Somewhat modular text2image GUI, initially just for Stable Diffusion
statiqdev/Statiq.Framework
A flexible and extensible static content generation framework for .NET.
Version Downloads Last updated
2.9.0-rc1 891 1/29/2024
2.8.1 255,941 8/21/2023
2.8.0 195,381 5/8/2023
2.7.3 12,207 5/1/2023
2.7.2 1,275,556 3/17/2022
2.7.1 333,752 9/20/2021
2.7.0 108,386 8/3/2021
2.6.0 48,310 6/24/2021
2.5.0 75,595 5/9/2021
2.4.3 465,280 7/19/2020
2.4.2 94,049 5/13/2020
2.4.1 2,421 5/11/2020
2.4.0 3,030 5/5/2020
2.3.1 27,146 4/12/2020
2.3.0 112,152 1/22/2020
2.2.0 147,219 10/27/2019
2.1.0 142,221 5/31/2019
2.0.0 776,988 6/20/2017
1.5.3 63,255 10/3/2016
1.5.2 2,681 10/2/2016
1.5.1 3,155 9/20/2016
1.5.0 3,847 9/13/2016
1.4.0 40,197 4/20/2016
1.3.0 2,848 3/28/2016
1.2.0 2,620 3/24/2016
1.1.0 32,983 8/9/2015
1.0.0 5,610 7/9/2015