Only scale image if needed
This commit is contained in:
@@ -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));
|
||||||
|
|||||||
Reference in New Issue
Block a user