我在本地主机上使用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
您必须安装 vcredist_x64-Main.exe 和 vcredist_x86-Main.exe