Auto rotate the uploaded image according to EXIF

This commit is contained in:
LittleSheep 2025-06-04 01:44:35 +08:00
parent 2f9df8009b
commit 1f01a4088c

View File

@ -194,6 +194,7 @@ public class FileService(
using var vipsImage = NetVips.Image.NewFromFile(ogFilePath);
var imagePath = Path.Join(Path.GetTempPath(), $"{TempFilePrefix}#{file.Id}");
vipsImage.Autorot();
vipsImage.WriteToFile(imagePath + ".webp",
new VOption { { "lossless", true } });
result.Add((imagePath + ".webp", string.Empty));