英文:
cannot convert from 'System.IO.Stream' to 'SixLabors.ImageSharp.Formats.DecoderOptions'
问题
我正在使用SixLabors包来调整Azure Blob存储中的图像大小,它在获取参数时显示错误,提示无法从'System.IO.Stream'转换为'SixLabors.ImageSharp.Formats.DecoderOptions'。
这是Visual Studio 2022的代码片段
显示错误的代码片段
我正在跟随Udemy上的一门课程,在这门课程中没有出现这个错误。
英文:
I am using SixLabors package to resize an image in Azure Blob Storage, it showing an error while taking parameters saying cannot convert from 'System.IO.Stream' to 'SixLabors.ImageSharp.Formats.DecoderOptions'.
This is a the code snippet of Visual Studio 2022
Code snippet showing error
i am following a course on udemy, in which this error didn't appear.
答案1
得分: 1
NuGet Package Version 3.0.0 of SixLoader.ImageSharp is giving this error. I Downgraded the package version and it is working.
英文:
The NuGet Package Version 3.0.0 of SixLoader.ImageSharp is giving this error. I Downgraded the package version and it is working.
答案2
得分: 0
In ImageSharp 3.0.0,他们移除了ImageFormat的out参数,而是将其与元数据一起返回。这是PR链接:https://github.com/SixLabors/ImageSharp/pull/2317
这是发布说明:https://sixlabors.com/posts/announcing-imagesharp-300/
详细的发布说明:https://github.com/SixLabors/ImageSharp/releases/tag/v3.0.0
这是新的用法:
IImageFormat format = image.Metadata.DecodedImageFormat;
"image" 是你的SixLabors.ImageSharp.Image image变量,显然。
英文:
In ImageSharp 3.0.0, they removed ImageFormat out params and rather return it with Metadata.
This is the PR: https://github.com/SixLabors/ImageSharp/pull/2317
This is the release notes: https://sixlabors.com/posts/announcing-imagesharp-300/
Detailed release notes: https://github.com/SixLabors/ImageSharp/releases/tag/v3.0.0
This is the new usage:
IImageFormat format = image.Metadata.DecodedImageFormat;
"image" is your SixLabors.ImageSharp.Image image variable, obviously.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论