c# - 如何在 Windows Server 上的 ASP.NET Core 7 中将照片转换为 webp 格式?

标签 c# iis webp

我在本地主机上使用asp.net core 7将照片转换为webp格式,但照片在Windows服务器上未转换

public static void GetWebp(int width, int height, int quality, string fullPath, string webpFile)
            {
                ResizeLayer rL = new(new Size(width, height));
                rL.ResizeMode = ResizeMode.Crop;
                using var webPFileStream = new FileStream(webpFile, FileMode.Create);
                using ImageFactory imageFactory = new ImageFactory(preserveExifData: false);
                imageFactory.Load(fullPath)
                            .Format(new WebPFormat())
                            .Quality(quality)
                            .Resize(rL)
                            .Save(webPFileStream);
            }

最佳答案

您必须准确安装版本 3.01 vcredist_x64-Main.exe 和 vcredist_x86-Main.exe

关于c# - 如何在 Windows Server 上的 ASP.NET Core 7 中将照片转换为 webp 格式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76347811/

相关文章:

asp.net - 如何确定 ASP.NET 站点 (IIS) 上的用户数量?他们的信息呢?

iis - 将工件发布到 IIS 上的远程 TeamCity 服务器时出现问题

c# - C# 的 WebP 库

c# - 通过值转换定义的属性进行 Linq 查询

c# - 在 c# 中创建一个用户定义的表类型以在 sql server 存储过程中使用

iis - web.config : rewrite only if *rewritten* path exists

javascript - 如何使用javascript更改点击时的图片srcset属性

c++ - 如何使用 Libwebp 从 Webp 解码和编码?

c# - 为什么 KeyDown 事件无法访问绑定(bind)变量的当前值?

c# - 带有 webHttpBinding 的 WCF 服务; 404错误