.Net 最好的 EXIF 库是什么?

发布于 2024-07-04 21:18:09 字数 62 浏览 11 评论 0原文

我正在寻找简单直接的解决方案来访问 .Net 中 jpeg 图像的 EXIF 信息。 有人有这方面的经验吗?

I am looking for simple straightforward solution for accessing EXIF information of jpeg images in .Net. Does anybody has experience with this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

榆西 2024-07-11 21:18:09

如果您愿意使用开源库,我可以谦虚地建议我自己创建一个吗?

metadata-extractor 项目自 2002 年以来一直在 Java 中运行良好,现在也可用于 .NET。

  • 开源 (Apache 2.0)
  • 经过大量测试和广泛使用
  • 支持多种图像类型(JPEG、TIFF、PNG、WebP、GIF、BMP、ICO、PCX...)
  • 支持多种元数据类型(Exif、IPTC、XMP、JFIF、.. .)
  • 支持许多制造商特定领域(佳能、尼康...)
  • 速度非常快(在约 3 秒内完全处理约 400 张图像,总计 1.33GB),内存消耗低
  • 针对 .NET 3.5、.NET 4.0+ 和 PCL

构建可通过 NuGetGitHub

使用示例:

IEnumerable<Directory> directories = ImageMetadataReader.ReadMetadata(path);

foreach (var directory in directories)
    foreach (var tag in directory.Tags)
        Console.WriteLine($"{directory.Name} - {tag.TagName} = {tag.Description}");

If you're willing to use an open-source library, may I humbly suggest one of my own creation?

The metadata-extractor project has been alive and well since 2002 for Java, and is now available for .NET.

  • Open source (Apache 2.0)
  • Heavily tested and widely used
  • Supports many image types (JPEG, TIFF, PNG, WebP, GIF, BMP, ICO, PCX...)
  • Supports many metadata types (Exif, IPTC, XMP, JFIF, ...)
  • Supports many manufacturer-specific fields (Canon, Nikon, ...)
  • Very fast (fully processes ~400 images totalling 1.33GB in ~3 seconds) with low memory consumption
  • Builds for .NET 3.5, .NET 4.0+ and PCL

It's available via NuGet or GitHub.

Sample usage:

IEnumerable<Directory> directories = ImageMetadataReader.ReadMetadata(path);

foreach (var directory in directories)
    foreach (var tag in directory.Tags)
        Console.WriteLine(
quot;{directory.Name} - {tag.TagName} = {tag.Description}");
纸短情长 2024-07-11 21:18:09

如果您针对框架 v3(或更高版本)进行编译,则可以使用 BitmapSource,它通过 元数据 属性

If you're compiling against v3 of the Framework (or later), then you can load the images using the BitmapSource class, which exposes the EXIF metadata through the Metadata property

谁的年少不轻狂 2024-07-11 21:18:09

Simon McKenzie 开发的 ExifLib - A Fast Exif Data Extractor for .NET 2.0 是一个非常快速的新库。 我最终使用了这个,代码很容易使用和理解。 我将它用于根据拍摄日期重命名的应用程序。 我想知道这样的应用程序已经被编写过多少次了。

我的提示:一旦完成 ExifReader 对象或文件保持打开状态,请确保对它们调用 Dispose。

A new and very fast library is ExifLib - A Fast Exif Data Extractor for .NET 2.0 by Simon McKenzie. I ended up using this one and the code is easy to use and understand. I used it for an app to rename according to the date taken. I wonder how many times such an app has been written.

My tip: Make sure to call Dispose on the ExifReader objects once you've finished with them or the files remain open.

想念有你 2024-07-11 21:18:09

我喜欢 Atalasoft 的 DotImage Photo,但它是一个闭源解决方案并且成本高昂每个开发许可证大约 600 个。

您还可以查看 Codeplex 的 DTools,这是一个旨在补充标准 Fx 的开源框架。 它包括一些Exif相关的类。

I like Atalasoft's DotImage Photo, but its a closed source solution and costs about 600 per dev license.

You can also check out DTools at Codeplex, which is an open source framework designed to supplement the standard Fx. It includes some Exif related classes.

淡淡の花香 2024-07-11 21:18:09

我在 feeddemon 中保存的一个,以便我有时间时可以查看更多内容(对于程序员来说什么时候?哈哈)在下面

ExifTagCollection - EXIF 元数据提取库

Mike

the one I have saved in feeddemon for me to check out more when I have time (when is that for a programmer? LOL) is below

ExifTagCollection - EXIF Metadata extraction library

Mike

早乙女 2024-07-11 21:18:09

几年前,我与 Omar Shahine 一起开发了一个名为 JpegHammer 的小型 JPEG EXIF 应用程序,用于处理 JPEG EXIF 文件。

他从该项目中提取了一个库并将其命名为 PhotoLibrary,它是 EXIF 2.2 标签的简单 .NET 包装器。 不幸的是,GotDotNet 网站已经消失,CodePlex 没有它,Omar 的网站链接不起作用,而且我也没有副本了。

但是,如果您可以在 Google 上进行挖掘,也许您会找到它,并且它会为您带来帮助。

Several years ago, I started a little JPEG EXIF app with Omar Shahine to work on JPEG EXIF files, called JpegHammer.

He extracted from that project a library and called it PhotoLibrary, it was an easy .NET wrapper for the EXIF 2.2 tags. Unfortunately, the GotDotNet site is gone, CodePlex doesn't have it, Omar's web site links don't work, and I don't have a copy anymore.

But, if you can dig around Google, maybe you'll find it and it'll do the trick for you.

天涯沦落人 2024-07-11 21:18:09

查看这个元数据提取器。 它是用 Java 编写的,但也已移植到 C#。 我使用 Java 版本编写了一个小实用程序来根据日期和型号标签重命名我的 jpeg 文件。 非常容易使用。

Check out this metadata extractor. It is written in Java but has also been ported to C#. I have used the Java version to write a small utility to rename my jpeg files based on the date and model tags. Very easy to use.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文