Reading data metadata from JPEG, XMP or EXIF in C#

前端 未结 5 2011
悲&欢浪女
悲&欢浪女 2020-12-14 18:56

I\'ve been looking around for a decent way of reading metadata (specifically, the date taken) from JPEG files in C#, and am coming up a little short. Existing information, a

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-14 19:48

    I've ported my long-time open-source Java library to .NET recently, and it supports XMP, Exif, ICC, JFIF and many more types of metadata across a range of image formats. It will definitely achieve what you're after.

    https://github.com/drewnoakes/metadata-extractor-dotnet

    var directories = ImageMetadataReader.ReadMetadata(imagePath);
    var subIfdDirectory = directories.OfType().FirstOrDefault();
    var dateTime = subIfdDirectory?.GetDescription(ExifDirectoryBase.TagDateTime);
    

    This library also supports XMP data, via a C# port of Adobe's XmpCore library for Java.

    https://github.com/drewnoakes/xmp-core-dotnet

提交回复
热议问题