Only scale image if needed

This commit is contained in:
2026-02-17 16:56:46 +09:00
parent 5b03ab8dc3
commit 07a369e462
+3
View File
@@ -620,7 +620,10 @@ class MainViewModel : BaseViewModel, IFontResolver
// Save frame as jpg // Save frame as jpg
var outputPath = Path.Combine(convertedDir, info.Name + ".jpg"); var outputPath = Path.Combine(convertedDir, info.Name + ".jpg");
mImage.Quality = 80; mImage.Quality = 80;
if (mImage.Width >= 400 || mImage.Height >= 400)
{
mImage.Scale((uint)Math.Floor(mImage.Width * 0.5), (uint)Math.Floor(mImage.Height * 0.5)); mImage.Scale((uint)Math.Floor(mImage.Width * 0.5), (uint)Math.Floor(mImage.Height * 0.5));
}
await mImage.WriteAsync(outputPath); await mImage.WriteAsync(outputPath);
filePath = Path.Combine("Converted", info.Name + ".jpg"); filePath = Path.Combine("Converted", info.Name + ".jpg");
LogInfo(string.Format("Converted image to JPEG; fileName is now {0}", file.FilePath)); LogInfo(string.Format("Converted image to JPEG; fileName is now {0}", file.FilePath));