• Stars
    star
    885
  • Rank 49,520 (Top 2 %)
  • Language
    C#
  • License
    Other
  • Created almost 9 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files

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.

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
  • Ricoh
  • Samsung
  • Sanyo
  • Sigma/Foveon
  • Sony

Supported Frameworks

This library targets:

  • .NET 8.0 (net8.0)
  • .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.

net8.0 implements .NET 8, including support for NativeAOT.

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:

More Repositories

1

metadata-extractor

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Java
2,478
star
2

figgle

ASCII banner generation for .NET
C#
328
star
3

string-theory

Identify and reduce memory used by duplicate .NET strings
C#
295
star
4

joystick

A minimal C++ object-oriented API onto joystick devices under Linux
C++
156
star
5

metadata-extractor-images

Database of images from various digital cameras
PostScript
100
star
6

fix-decoder

Unravels FIX messages into human readable tables
JavaScript
78
star
7

vs-side-scroller

Scroll horizontally with the mouse wheel when holding the shift key in Visual Studio
C#
72
star
8

il-visualizer

.NET debugging visualiser for runtime-generated IL code (via DynamicMethod, etc) for VS2017 and VS2015
C#
69
star
9

style-snooper

Extract default WPF styles for controls
C#
59
star
10

xmp-core-dotnet

.NET library for working with the Extensible Metadata Platform (XMP)
C#
58
star
11

dependency-analyser

Shows the dependencies between .NET projects and assemblies as a graph.
C#
41
star
12

amusing

A command-line tool that shows what namespaces you am-using.
C#
23
star
13

nquant

A fork of https://nquant.codeplex.com with several performance improvements to reduce CPU and memory usage
C#
23
star
14

quadrilateral-finder

A solution to the computer vision problem of finding a quadrilateral shape from a set of scattered line segments
C#
13
star
15

tin-man

Program your own RoboCup 3D soccer playing agents in .NET
C#
13
star
16

suo

View contents of Visual Studio SUO files
C#
11
star
17

adobe-xmp-core

Reconstructed history of Adobe's Java XMPCore library from Maven sources
Java
10
star
18

lwsxx

A C++ API for the C libwebsockets library
C++
9
star
19

pew-pew

Sound effect synthesizer for .NET
C#
7
star
20

molly

Linux tools for the "Big Red Button" USB device manufactured by Dream Cheeky
C++
5
star
21

solution-generator

Generate solutions with arbitrary numbers of projects/files for testing purposes
C#
4
star
22

generate-code-sample

Sample code that shows generation of source code during build via MSBuild
C#
4
star
23

copy-across-project-references

Exploring .NET build behaviour when copying files across project references
C#
4
star
24

beep

Machine that goes ping, for your command line
C#
3
star
25

hex-dump

Formats a hex dump from bytes
C#
3
star
26

gitlucky

Amends the last git commit to have the desired SHA-1 prefix.
C#
2
star
27

attached-collections-sample

An example of extending Visual Studio's Solution Explorer via the attached collections APIs
C#
2
star
28

mini-lisp

Minimal C# lisp expression evaluator
C#
2
star
29

settings

Miscellaneous settings files. There's probably nothing interesting here, unless you're me.
Lua
2
star
30

msgpack-vs-visualiser-dotnet

Visual Studio Debugger Visualizer for MsgPack encoded byte arrays
C#
2
star
31

natural-sort

A .NET string comparer that orders integers within strings correctly.
C#
2
star
32

palettes

Simple web page for displaying colour palettes
JavaScript
2
star
33

SettingsProject

C#
1
star
34

optimistic-immutable-collections

Familiar collection API that wraps persistent collections and use lock-free operations for safety and correctness
C#
1
star
35

biggus-griddus-demo

Demonstrates usage of the biggus-griddus library.
JavaScript
1
star