简体   繁体   English

如何在 AspNet.Core 中读取 EXIF 数据

[英]How can i read EXIF data in AspNet.Core

What's the best way to read EXIF info of a picture in Asp.Net Core.在 Asp.Net Core 中读取图片的 EXIF 信息的最佳方法是什么。 I am using ImageProcessorCore alpha from myget to rotate pictures but i haven't found a way to read exif data is there a in library way of doing this?我正在使用 myget 中的 ImageProcessorCore alpha 来旋转图片,但我还没有找到读取 exif 数据的方法,库中是否有这样做的方法?

The lightweight ExifLib has now been ported to .net Standard/.net Core.轻量级 ExifLib 现在已移植到 .net Standard/.net Core。

I have confirmed it also works on Linux.我已经确认它也适用于 Linux。

https://www.nuget.org/packages/ExifLib.Standard/ https://www.nuget.org/packages/ExifLib.Standard/

I was able to find a library that reads exif info and it is available for .net core i am using it in my Asp.Net Core.我能够找到一个读取 exif 信息的库,它可用于 .net 核心,我在我的 Asp.Net 核心中使用它。

https://magick.codeplex.com/wikipage?title=Exif%20data&referringTitle=Documentation https://magick.codeplex.com/wikipage?title=Exif%20data&referringTitle=文档

This also looks like a good imaging library but i haven't tried it yet Cheers to the creators.这看起来也是一个不错的图像库,但我还没有尝试过 为创作者干杯。

ImageSharp is cross platform ( https://github.com/SixLabors/ImageSharp ) and worked for me on Linux out of the box. ImageSharp 是跨平台的 ( https://github.com/SixLabors/ImageSharp ),并且在 Linux 上为我开箱即用。 It is still in beta but for me it works OK, I am only using exif parsing capabilities它仍处于测试阶段,但对我来说它工作正常,我只使用 exif 解析功能

The accepted solution will (as of today) not work on Linux machines.已接受的解决方案(截至今天)不适用于 Linux 机器。

Therefore, I have used the source of ExifLib: https://www.codeproject.com/Articles/36342/ExifLib-A-Fast-Exif-Data-Extractor-for-NET因此,我使用了ExifLib的来源: https ://www.codeproject.com/Articles/36342/ExifLib-A-Fast-Exif-Data-Extractor-for-NET

I slightly modified it to use Dispose() on streams and readers instead of Close().我稍微修改了它以在流和读取器上使用 Dispose() 而不是 Close()。 For just reading exif data, it performs well because it reads the binary data instead of using expensive GDI objects.对于仅读取 exif 数据,它表现良好,因为它读取二进制数据而不是使用昂贵的 GDI 对象。

I used Magick.NET.Core , it has much more capabilities than EXIF,我使用了Magick.NET.Core ,它比 EXIF 有更多的功能,

The source code can be found here - github library: https://www.nuget.org/packages/Magick.NET.Core/源代码可以在这里找到 - github 库: https : //www.nuget.org/packages/Magick.NET.Core/

And the specific EXIF documentation: https://github.com/dlemstra/Magick.NET/blob/main/docs/ExifData.md以及具体的 EXIF 文档: https : //github.com/dlemstra/Magick.NET/blob/main/docs/ExifData.md

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将.NetFramework 中的MessageHandler 转换为AspNet.Core - How to convert MessageHandler in .NetFramework to AspNet.Core Aspnet.core 程序登录但考虑同一个表中的数据 - The Aspnet.core program logs in but considers the data in the same table aspnet.core 使用 UserManager 播种数据<identityuser></identityuser> - aspnet.core Seeding data using UserManager<IdentityUser> 如何在aspnet.core web api中验证JWT令牌? - How to validate JWT Token in aspnet.core web api? 用于集成测试的ASPNet.Core HostingEnvironment? - ASPNet.Core HostingEnvironment for Integration Tests? 使用Angular时,无法获取aspnet.core服务器路由以默认路径加载 - Can't get aspnet.core server route to load with default path, when using Angular 如何在ASPNET.Core Web应用程序中使用CORS标头发送HTTP 4xx-5xx响应? - How to send an HTTP 4xx-5xx response with CORS headers in an ASPNET.Core web app? 如何在Aspnet.core Razor中的foreach循环中使用Model动态填充HTML? - How to populate HTML dynamically with Model in a foreach loop in Aspnet.core Razor? 如何使用[HttpGetAttribute]路由包括AspNet.Core WebApi应用程序中的查询字符串? - How to route using [HttpGetAttribute] including the query strings in AspNet.Core WebApi application? 是否可以为ASPNET.Core OData声明多个路由 - Is it possible to declare multiple routes for ASPNET.Core OData
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM