From 944d8f915e3ba0117ac89df0f606aa6ab85bc1f2 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 6 Oct 2021 00:33:44 +1100 Subject: [PATCH] Additional fixes + gitignore --- .gitignore | 4 ++++ .../LoadResizeSave/LoadResizeSaveStressRunner.cs | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 769a40c6cc..fadf36964c 100644 --- a/.gitignore +++ b/.gitignore @@ -223,3 +223,7 @@ artifacts/ **/Images/ReferenceOutput **/Images/Input/MemoryStress .DS_Store + +#lfs +hooks/** +lfs/** diff --git a/tests/ImageSharp.Benchmarks/LoadResizeSave/LoadResizeSaveStressRunner.cs b/tests/ImageSharp.Benchmarks/LoadResizeSave/LoadResizeSaveStressRunner.cs index f9decef255..ba6bc2cdd1 100644 --- a/tests/ImageSharp.Benchmarks/LoadResizeSave/LoadResizeSaveStressRunner.cs +++ b/tests/ImageSharp.Benchmarks/LoadResizeSave/LoadResizeSaveStressRunner.cs @@ -160,7 +160,7 @@ public void SystemDrawingResize(string input) using var image = SystemDrawingImage.FromFile(input, true); this.IncreaseTotalMegapixels(image.Width, image.Height); - (int Width, int Height) scaled = this.ScaledSize(image.Width, image.Height, ThumbnailSize); + (int Width, int Height) scaled = this.ScaledSize(image.Width, image.Height, this.ThumbnailSize); var resized = new Bitmap(scaled.Width, scaled.Height); using var graphics = Graphics.FromImage(resized); using var attributes = new ImageAttributes(); @@ -188,7 +188,7 @@ public void ImageSharpResize(string input) image.Mutate(i => i.Resize(new ResizeOptions { - Size = new ImageSharpSize(ThumbnailSize, ThumbnailSize), + Size = new ImageSharpSize(this.ThumbnailSize, this.ThumbnailSize), Mode = ResizeMode.Max })); @@ -205,7 +205,7 @@ public void MagickResize(string input) this.IncreaseTotalMegapixels(image.Width, image.Height); // Resize it to fit a 150x150 square - image.Resize(ThumbnailSize, ThumbnailSize); + image.Resize(this.ThumbnailSize, this.ThumbnailSize); // Reduce the size of the file image.Strip(); @@ -221,8 +221,8 @@ public void MagicScalerResize(string input) { var settings = new ProcessImageSettings() { - Width = ThumbnailSize, - Height = ThumbnailSize, + Width = this.ThumbnailSize, + Height = this.ThumbnailSize, ResizeMode = CropScaleMode.Max, SaveFormat = FileFormat.Jpeg, JpegQuality = Quality, @@ -238,7 +238,7 @@ public void SkiaCanvasResize(string input) { using var original = SKBitmap.Decode(input); this.IncreaseTotalMegapixels(original.Width, original.Height); - (int Width, int Height) scaled = this.ScaledSize(original.Width, original.Height, ThumbnailSize); + (int Width, int Height) scaled = this.ScaledSize(original.Width, original.Height, this.ThumbnailSize); using var surface = SKSurface.Create(new SKImageInfo(scaled.Width, scaled.Height, original.ColorType, original.AlphaType)); using var paint = new SKPaint() { FilterQuality = SKFilterQuality.High }; SKCanvas canvas = surface.Canvas; @@ -256,7 +256,7 @@ public void SkiaBitmapResize(string input) { using var original = SKBitmap.Decode(input); this.IncreaseTotalMegapixels(original.Width, original.Height); - (int Width, int Height) scaled = this.ScaledSize(original.Width, original.Height, ThumbnailSize); + (int Width, int Height) scaled = this.ScaledSize(original.Width, original.Height, this.ThumbnailSize); using var resized = original.Resize(new SKImageInfo(scaled.Width, scaled.Height), SKFilterQuality.High); if (resized == null) { @@ -272,7 +272,7 @@ public void SkiaBitmapResize(string input) public void NetVipsResize(string input) { // Thumbnail to fit a 150x150 square - using var thumb = NetVipsImage.Thumbnail(input, ThumbnailSize, ThumbnailSize); + using var thumb = NetVipsImage.Thumbnail(input, this.ThumbnailSize, this.ThumbnailSize); // Save the results thumb.Jpegsave(this.OutputPath(input, NetVips), q: Quality, strip: true);