MetadataExtractor 2.8.1
See the version list below for details.
dotnet add package MetadataExtractor --version 2.8.1
NuGet\Install-Package MetadataExtractor -Version 2.8.1
<PackageReference Include="MetadataExtractor" Version="2.8.1" />
paket add MetadataExtractor --version 2.8.1
#r "nuget: MetadataExtractor, 2.8.1"
// 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
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:
- Exif
- IPTC
- XMP
- JFIF / JFXX
- ICC Profiles
- Photoshop fields
- WebP properties
- Netpbm properties
- PNG properties
- BMP properties
- GIF properties
- ICO properties
- PCX properties
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 | Versions 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. |
-
.NETFramework 3.5
- XmpCore (>= 6.1.10.1)
-
.NETFramework 4.5
- XmpCore (>= 6.1.10.1)
-
.NETStandard 1.3
- NETStandard.Library (>= 1.6.1)
- System.Text.Encoding.CodePages (>= 4.5.1)
- XmpCore (>= 6.1.10.1)
-
.NETStandard 2.0
- System.Text.Encoding.CodePages (>= 4.5.1)
- XmpCore (>= 6.1.10.1)
NuGet packages (26)
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. |
|
MudBlazor.Extensions
MudBlazor.Extensions is a small extension library for MudBlazor from https://mudblazor.com/ |
|
Wyam.Xmp
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 |
GitHub repositories (11)
Showing the top 5 popular GitHub repositories that depend on MetadataExtractor:
Repository | Stars |
---|---|
LykosAI/StabilityMatrix
Multi-Platform Package Manager for Stable Diffusion
|
|
ElevenPaths/FOCA
Tool to find metadata and hidden information in the documents.
|
|
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 | 3,730 | 3/21/2024 | |
2.9.0-rc1 | 2,130 | 1/29/2024 | |
2.8.1 | 722,913 | 8/21/2023 | |
2.8.0 | 257,126 | 5/8/2023 | |
2.7.3 | 15,636 | 5/1/2023 | |
2.7.2 | 1,530,408 | 3/17/2022 | |
2.7.1 | 395,880 | 9/20/2021 | |
2.7.0 | 130,141 | 8/3/2021 | |
2.6.0 | 50,100 | 6/24/2021 | |
2.5.0 | 104,704 | 5/9/2021 | |
2.4.3 | 516,364 | 7/19/2020 | |
2.4.2 | 98,376 | 5/13/2020 | |
2.4.1 | 2,599 | 5/11/2020 | |
2.4.0 | 3,275 | 5/5/2020 | |
2.3.1 | 30,059 | 4/12/2020 | |
2.3.0 | 141,889 | 1/22/2020 | |
2.2.0 | 175,079 | 10/27/2019 | |
2.1.0 | 144,630 | 5/31/2019 | |
2.0.0 | 820,398 | 6/20/2017 | |
1.5.3 | 69,487 | 10/3/2016 | |
1.5.2 | 2,870 | 10/2/2016 | |
1.5.1 | 3,344 | 9/20/2016 | |
1.5.0 | 4,225 | 9/13/2016 | |
1.4.0 | 41,234 | 4/20/2016 | |
1.3.0 | 3,053 | 3/28/2016 | |
1.2.0 | 2,811 | 3/24/2016 | |
1.1.0 | 37,252 | 8/9/2015 | |
1.0.0 | 6,253 | 7/9/2015 |