MetadataExtractor 2.9.0-rc1

This is a prerelease version of MetadataExtractor.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package MetadataExtractor --version 2.9.0-rc1
NuGet\Install-Package MetadataExtractor -Version 2.9.0-rc1
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.9.0-rc1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MetadataExtractor --version 2.9.0-rc1
#r "nuget: MetadataExtractor, 2.9.0-rc1"
#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.9.0-rc1&prerelease

// Install MetadataExtractor as a Cake Tool
#tool nuget:?package=MetadataExtractor&version=2.9.0-rc1&prerelease

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 4.6.2 (net462)
  • .NET Standard 1.3 (netstandard1.3)
  • .NET Standard 2.1 (netstandard2.1)

All target frameworks are provided via the one NuGet package.

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

netstandard2.1 implements version 2.1 of the .NET Standard, which uses newer APIs where possible.

net462 targets the full .NET Framework, from version 4.6.2 onwards.

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.

A net3.5 build was supported until version 2.8.1. Support for this framework was dropped in early 2024 to enable use of newer, more efficient, .NET 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 was computed.  netstandard2.1 is compatible. 
.NET Framework net46 was computed.  net461 was computed.  net462 is compatible.  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 (22)

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-rc2 541 3/21/2024
2.9.0-rc1 1,130 1/29/2024
2.8.1 298,549 8/21/2023
2.8.0 202,796 5/8/2023
2.7.3 12,780 5/1/2023
2.7.2 1,309,621 3/17/2022
2.7.1 340,837 9/20/2021
2.7.0 111,557 8/3/2021
2.6.0 48,442 6/24/2021
2.5.0 76,773 5/9/2021
2.4.3 470,922 7/19/2020
2.4.2 94,555 5/13/2020
2.4.1 2,499 5/11/2020
2.4.0 3,106 5/5/2020
2.3.1 27,731 4/12/2020
2.3.0 115,606 1/22/2020
2.2.0 150,418 10/27/2019
2.1.0 142,505 5/31/2019
2.0.0 787,513 6/20/2017
1.5.3 64,892 10/3/2016
1.5.2 2,760 10/2/2016
1.5.1 3,233 9/20/2016
1.5.0 3,956 9/13/2016
1.4.0 40,486 4/20/2016
1.3.0 2,926 3/28/2016
1.2.0 2,701 3/24/2016
1.1.0 35,616 8/9/2015
1.0.0 5,714 7/9/2015