Reading EXIF data from JPG

20,690

Solution 1

You'll find some code samples in ExifLib - A Fast Exif Data Extractor for .NET 2.0+ (and a full project too) that shows how to read the minimum data necessary to get just the EXIF information out.

Solution 2

I've recently ported my Java metadata-extractor library to .NET. It's been active since 2002 and had heavy testing through widespread use. In my tests, it churns through 2GB of images, extracting all metadata within in around 4 seconds on my machine. You could optimise further by telling it to only read specific types of metadata, such as Exif. It supports many image/video formats, and many metadata types.

Available on GitHub and NuGet.

Solution 3

GdPicture.NET Imaging SDK starting version 10 provides a new image parsing mechanism that allows direct access to image metadata (EXIF, GPS, XMP, IPTC...) without decoding pixels. It supports more than 90 image formats including JPEG, TIFF, RAW and WebP.

Here a link the the GdPicture.NET knowledge base that demonstrates how to extract metadata using C# and VB.NET (many other languages are also supported): tutorial

In case anybody needs further information I will be glad to assist.

Disclaimer: I am the product architect of GdPicture.NET.

Share:
20,690
Marek Kwiendacz
Author by

Marek Kwiendacz

C#, SQL, javascript, C++, html developer.

Updated on January 04, 2020

Comments

  • Marek Kwiendacz
    Marek Kwiendacz over 4 years

    I need to analyze thousands of jpeg files (by retrieving it EXIF data). It is more than 50 GB of data.I cannot read whole files because it'll take too much time.

    Is there any method in C# to read only EXIF data from those files without need of loading and decompressing whole jpeg files?

    EDIT: Why I need fast method?
    I've tried solution from this question: How to get the EXIF data from a file using C#
    And for 1000 images with total size ~ 1GB it took 3 minutes to analyze. So for larger (50G) library of photos it could take 2 hours. And when you need almost immedietelly information like: "What is preffered zoom used by your customer" it is too slow.