Optimize thumbnail rendering for image edits

This commit is contained in:
Ben Olden-Cooligan 2019-07-06 16:14:09 -04:00
parent 804832e93c
commit 7fc21eb7ab

View File

@ -158,6 +158,12 @@ namespace NAPS2.WinForms
{
img.AddTransform(t);
}
// Optimize thumbnail rendering for the first (or only) image since we already have it loaded into memory
if (img == Image)
{
var transformed = imageContext.PerformAllTransforms(new GdiImage(workingImage).Clone(), Transforms);
img.SetThumbnail(imageContext.PerformTransform(transformed, new ThumbnailTransform(ConfigProvider.Get(c => c.ThumbnailSize))));
}
}
}
changeTracker.Made();