home | software | metadata-extractor
metadata-extractor lets you access the metadata in digital images and video via a simple API.
Image file types:
Video file types:
Metadata formats:
Manufacturer makernote support:
A single image may contain multiple kinds of metadata.
[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
...
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);
}
}
}
var directories = ImageMetadataReader.ReadMetadata(file);
foreach (var directory in directories)
{
foreach (var tag in directory.Tags)
Console.WriteLine($"[{directory.Name}] {tag.Name} = {tag.Description}");
if (directory.HasError)
{
foreach (var error in directory.Errors)
Console.WriteLine($"ERROR: {error}");
}
}
Metadata metadata = ImageMetadataReader.readMetadata(file);
ExifSubIFDDirectory directory = metadata.getFirstDirectoryOfType(ExifSubIFDDirectory.class);
Date date = directory.getDate(ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL);
var directories = ImageMetadataReader.ReadMetadata(file);
var subIfdDirectory = directories.OfType<ExifSubIfdDirectory>().FirstOrDefault();
var dateTime = subIfdDirectory?.GetDescription(ExifDirectoryBase.TagDateTime);
There are several ways to get involved:
Contact with users and contributors encourages and motivates me to keep making improvements.
Ask a question on Stack Overflow using the metadata-extractor
tag, or try the mailing list (see below).
Read the wiki, Javadoc and sample code.
The sample code above and the readme is enough to get started. Why not contribute to the project wiki, or open a pull request with some sample code?
You may use the project via Maven.
Alternatively, download the source and/or compiled binaries from the releases page.
The library is available on NuGet:
Install-Package MetadataExtractor
The NuGet package targets .NET 4.5, .NET 3.5, Silverlight 5.0, Windows 8.0+, Windows Phone 8.1+ and Windows Phone Silverlight 8.0
Change log and GitHub releases.
You may use this library within the terms of the Apache License 2. Please send me a short email to let me know if you find it useful.
You are free to sell work based upon this library, though please consider making a donation.
If you've found this library useful and would like to thank the author, you can make a donation to show your appreciation for the many hours spent on this project.