Browse Source

Fix final StyleCop warnings in tests

pull/1777/head
James Jackson-South 4 years ago
parent
commit
4a09fd9bba
  1. 2
      tests/ImageSharp.Benchmarks/Codecs/DecodeTiff.cs
  2. 1
      tests/ImageSharp.Benchmarks/Codecs/EncodeTiff.cs
  3. 43
      tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_CopyTo1x1.cs
  4. 1
      tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_CopyTo2x2.cs
  5. 1
      tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_DivideRound.cs
  6. 1
      tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_LoadFromInt16.cs
  7. 2
      tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_Round.cs
  8. 2
      tests/ImageSharp.Benchmarks/Color/Bulk/FromVector4.cs
  9. 1
      tests/ImageSharp.Benchmarks/Color/Bulk/ToVector4_Rgba32.cs
  10. 1
      tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.cs
  11. 1
      tests/ImageSharp.Benchmarks/General/Array2D.cs
  12. 1
      tests/ImageSharp.Benchmarks/General/ArrayReverse.cs
  13. 1
      tests/ImageSharp.Benchmarks/General/BasicMath/Abs.cs
  14. 1
      tests/ImageSharp.Benchmarks/General/BasicMath/ClampFloat.cs
  15. 1
      tests/ImageSharp.Benchmarks/General/BasicMath/ClampInt32IntoByte.cs
  16. 1
      tests/ImageSharp.Benchmarks/General/BasicMath/ClampVector4.cs
  17. 1
      tests/ImageSharp.Benchmarks/General/BasicMath/Pow.cs
  18. 1
      tests/ImageSharp.Benchmarks/General/CopyBuffers.cs
  19. 1
      tests/ImageSharp.Benchmarks/General/PixelConversion/ITestPixel.cs
  20. 1
      tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_ConvertFromRgba32.cs
  21. 1
      tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_ConvertFromVector4.cs
  22. 1
      tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_ConvertToRgba32.cs
  23. 1
      tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_ConvertToRgba32_AsPartOfCompositeOperation.cs
  24. 1
      tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_ConvertToVector4.cs
  25. 1
      tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_ConvertToVector4_AsPartOfCompositeOperation.cs
  26. 22
      tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_PackFromRgbPlanes.cs
  27. 1
      tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_Rgba32_To_Argb32.cs
  28. 1
      tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_Rgba32_To_Bgra32.cs
  29. 1
      tests/ImageSharp.Benchmarks/General/PixelConversion/TestArgb.cs
  30. 1
      tests/ImageSharp.Benchmarks/General/PixelConversion/TestRgba.cs
  31. 1
      tests/ImageSharp.Benchmarks/General/Vector4Constants.cs
  32. 1
      tests/ImageSharp.Benchmarks/General/Vectorization/BitwiseOrUint32.cs
  33. 1
      tests/ImageSharp.Benchmarks/General/Vectorization/DivFloat.cs
  34. 1
      tests/ImageSharp.Benchmarks/General/Vectorization/DivUInt32.cs
  35. 1
      tests/ImageSharp.Benchmarks/General/Vectorization/Divide.cs
  36. 1
      tests/ImageSharp.Benchmarks/General/Vectorization/MulFloat.cs
  37. 1
      tests/ImageSharp.Benchmarks/General/Vectorization/MulUInt32.cs
  38. 1
      tests/ImageSharp.Benchmarks/General/Vectorization/ReinterpretUInt32AsFloat.cs
  39. 1
      tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs
  40. 1
      tests/ImageSharp.Benchmarks/General/Vectorization/UInt32ToSingle.cs
  41. 1
      tests/ImageSharp.Benchmarks/General/Vectorization/WidenBytesToUInt32.cs
  42. 18
      tests/ImageSharp.Benchmarks/LoadResizeSave/LoadResizeSaveStressRunner.cs
  43. 4
      tests/ImageSharp.Tests.ProfilingSandbox/LoadResizeSaveParallelMemoryStress.cs
  44. 3
      tests/ImageSharp.Tests.ProfilingSandbox/Program.cs

2
tests/ImageSharp.Benchmarks/Codecs/DecodeTiff.cs

@ -6,12 +6,10 @@
//// #define BIG_TESTS
using System.IO;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Tests;
using SDImage = System.Drawing.Image;
using SDSize = System.Drawing.Size;

1
tests/ImageSharp.Benchmarks/Codecs/EncodeTiff.cs

@ -3,7 +3,6 @@
using System.Drawing.Imaging;
using System.IO;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.Formats.Tiff;

43
tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_CopyTo1x1.cs

@ -5,14 +5,11 @@ using System;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
#if SUPPORTS_RUNTIME_INTRINSICS
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
#endif
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.Formats.Jpeg.Components;
// ReSharper disable InconsistentNaming
@ -319,26 +316,28 @@ namespace SixLabors.ImageSharp.Benchmarks.Codecs.Jpeg.BlockOperations
{
int stride = Width;
fixed (float* d = this.unpinnedBuffer)
fixed (Block8x8F* ss = &this.block)
{
var s = (float*)ss;
Vector256<float> v0 = Avx.LoadVector256(s);
Vector256<float> v1 = Avx.LoadVector256(s + 8);
Vector256<float> v2 = Avx.LoadVector256(s + (8 * 2));
Vector256<float> v3 = Avx.LoadVector256(s + (8 * 3));
Avx.Store(d, v0);
Avx.Store(d + stride, v1);
Avx.Store(d + (stride * 2), v2);
Avx.Store(d + (stride * 3), v3);
v0 = Avx.LoadVector256(s + (8 * 4));
v1 = Avx.LoadVector256(s + (8 * 5));
v2 = Avx.LoadVector256(s + (8 * 6));
v3 = Avx.LoadVector256(s + (8 * 7));
Avx.Store(d + (stride * 4), v0);
Avx.Store(d + (stride * 5), v1);
Avx.Store(d + (stride * 6), v2);
Avx.Store(d + (stride * 7), v3);
fixed (Block8x8F* ss = &this.block)
{
var s = (float*)ss;
Vector256<float> v0 = Avx.LoadVector256(s);
Vector256<float> v1 = Avx.LoadVector256(s + 8);
Vector256<float> v2 = Avx.LoadVector256(s + (8 * 2));
Vector256<float> v3 = Avx.LoadVector256(s + (8 * 3));
Avx.Store(d, v0);
Avx.Store(d + stride, v1);
Avx.Store(d + (stride * 2), v2);
Avx.Store(d + (stride * 3), v3);
v0 = Avx.LoadVector256(s + (8 * 4));
v1 = Avx.LoadVector256(s + (8 * 5));
v2 = Avx.LoadVector256(s + (8 * 6));
v3 = Avx.LoadVector256(s + (8 * 7));
Avx.Store(d + (stride * 4), v0);
Avx.Store(d + (stride * 5), v1);
Avx.Store(d + (stride * 6), v2);
Avx.Store(d + (stride * 7), v3);
}
}
}

1
tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_CopyTo2x2.cs

@ -3,7 +3,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.Formats.Jpeg.Components;

1
tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_DivideRound.cs

@ -3,7 +3,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.Formats.Jpeg.Components;

1
tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_LoadFromInt16.cs

@ -3,7 +3,6 @@
using System;
using System.Numerics;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.Formats.Jpeg.Components;

2
tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_Round.cs

@ -5,12 +5,10 @@ using System;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
#if SUPPORTS_RUNTIME_INTRINSICS
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
#endif
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.Formats.Jpeg.Components;

2
tests/ImageSharp.Benchmarks/Color/Bulk/FromVector4.cs

@ -6,12 +6,10 @@ using System.Buffers;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
#if SUPPORTS_RUNTIME_INTRINSICS
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
#endif
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;

1
tests/ImageSharp.Benchmarks/Color/Bulk/ToVector4_Rgba32.cs

@ -5,7 +5,6 @@ using System;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.Memory;

1
tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.cs

@ -3,7 +3,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.Formats.Jpeg.Components;

1
tests/ImageSharp.Benchmarks/General/Array2D.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp;

1
tests/ImageSharp.Benchmarks/General/ArrayReverse.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General

1
tests/ImageSharp.Benchmarks/General/BasicMath/Abs.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.BasicMath

1
tests/ImageSharp.Benchmarks/General/BasicMath/ClampFloat.cs

@ -3,7 +3,6 @@
using System;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.BasicMath

1
tests/ImageSharp.Benchmarks/General/BasicMath/ClampInt32IntoByte.cs

@ -3,7 +3,6 @@
using System;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.BasicMath

1
tests/ImageSharp.Benchmarks/General/BasicMath/ClampVector4.cs

@ -3,7 +3,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.BasicMath

1
tests/ImageSharp.Benchmarks/General/BasicMath/Pow.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.BasicMath

1
tests/ImageSharp.Benchmarks/General/CopyBuffers.cs

@ -5,7 +5,6 @@ using System;
using System.Buffers;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General

1
tests/ImageSharp.Benchmarks/General/PixelConversion/ITestPixel.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System.Numerics;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Benchmarks.General.PixelConversion

1
tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_ConvertFromRgba32.cs

@ -4,7 +4,6 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.PixelFormats;

1
tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_ConvertFromVector4.cs

@ -4,7 +4,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.PixelFormats;

1
tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_ConvertToRgba32.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.PixelFormats;

1
tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_ConvertToRgba32_AsPartOfCompositeOperation.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.PixelFormats;

1
tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_ConvertToVector4.cs

@ -3,7 +3,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.PixelConversion

1
tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_ConvertToVector4_AsPartOfCompositeOperation.cs

@ -3,7 +3,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.PixelConversion

22
tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_PackFromRgbPlanes.cs

@ -50,16 +50,22 @@ namespace SixLabors.ImageSharp.Benchmarks.General.PixelConversion
public void Rgb24_Scalar_PerElement_Pinned()
{
fixed (byte* r = &this.rBuf[0])
fixed (byte* g = &this.gBuf[0])
fixed (byte* b = &this.bBuf[0])
fixed (Rgb24* rgb = &this.rgbBuf[0])
{
for (int i = 0; i < this.Count; i++)
fixed (byte* g = &this.gBuf[0])
{
Rgb24* d = rgb + i;
d->R = r[i];
d->G = g[i];
d->B = b[i];
fixed (byte* b = &this.bBuf[0])
{
fixed (Rgb24* rgb = &this.rgbBuf[0])
{
for (int i = 0; i < this.Count; i++)
{
Rgb24* d = rgb + i;
d->R = r[i];
d->G = g[i];
d->B = b[i];
}
}
}
}
}
}

1
tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_Rgba32_To_Argb32.cs

@ -4,7 +4,6 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.PixelFormats;

1
tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_Rgba32_To_Bgra32.cs

@ -5,7 +5,6 @@ using System;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.PixelFormats;

1
tests/ImageSharp.Benchmarks/General/PixelConversion/TestArgb.cs

@ -4,7 +4,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Benchmarks.General.PixelConversion

1
tests/ImageSharp.Benchmarks/General/PixelConversion/TestRgba.cs

@ -4,7 +4,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Benchmarks.General.PixelConversion

1
tests/ImageSharp.Benchmarks/General/Vector4Constants.cs

@ -3,7 +3,6 @@
using System;
using System.Numerics;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General

1
tests/ImageSharp.Benchmarks/General/Vectorization/BitwiseOrUint32.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System.Numerics;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization

1
tests/ImageSharp.Benchmarks/General/Vectorization/DivFloat.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System.Numerics;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization

1
tests/ImageSharp.Benchmarks/General/Vectorization/DivUInt32.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System.Numerics;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization

1
tests/ImageSharp.Benchmarks/General/Vectorization/Divide.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System.Numerics;
using BenchmarkDotNet.Attributes;
namespace ImageSharp.Benchmarks.General.Vectorization

1
tests/ImageSharp.Benchmarks/General/Vectorization/MulFloat.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System.Numerics;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization

1
tests/ImageSharp.Benchmarks/General/Vectorization/MulUInt32.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using System.Numerics;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization

1
tests/ImageSharp.Benchmarks/General/Vectorization/ReinterpretUInt32AsFloat.cs

@ -3,7 +3,6 @@
using System.Numerics;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization

1
tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

@ -3,7 +3,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
namespace ImageSharp.Benchmarks.General.Vectorization

1
tests/ImageSharp.Benchmarks/General/Vectorization/UInt32ToSingle.cs

@ -3,7 +3,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization

1
tests/ImageSharp.Benchmarks/General/Vectorization/WidenBytesToUInt32.cs

@ -3,7 +3,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using SixLabors.ImageSharp.Tuples;

18
tests/ImageSharp.Benchmarks/LoadResizeSave/LoadResizeSaveStressRunner.cs

@ -42,7 +42,7 @@ namespace SixLabors.ImageSharp.Benchmarks.LoadResizeSave
private const string SkiaSharpBitmap = nameof(SkiaSharpBitmap);
// Set the quality for ImagSharp
private readonly JpegEncoder imageSharpJpegEncoder = new () { Quality = Quality };
private readonly JpegEncoder imageSharpJpegEncoder = new() { Quality = Quality };
private readonly ImageCodecInfo systemDrawingJpegCodec =
ImageCodecInfo.GetImageEncoders().First(codec => codec.FormatID == ImageFormat.Jpeg.Guid);
@ -137,7 +137,7 @@ namespace SixLabors.ImageSharp.Benchmarks.LoadResizeSave
this.outputDirectory,
Path.GetFileNameWithoutExtension(inputPath) + "-" + postfix + Path.GetExtension(inputPath));
private (int width, int height) ScaledSize(int inWidth, int inHeight, int outSize)
private (int Width, int Height) ScaledSize(int inWidth, int inHeight, int outSize)
{
int width, height;
if (inWidth > inHeight)
@ -159,8 +159,8 @@ namespace SixLabors.ImageSharp.Benchmarks.LoadResizeSave
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);
var resized = new Bitmap(scaled.width, scaled.height);
(int Width, int Height) scaled = this.ScaledSize(image.Width, image.Height, ThumbnailSize);
var resized = new Bitmap(scaled.Width, scaled.Height);
using var graphics = Graphics.FromImage(resized);
using var attributes = new ImageAttributes();
attributes.SetWrapMode(WrapMode.TileFlipXY);
@ -237,11 +237,11 @@ namespace SixLabors.ImageSharp.Benchmarks.LoadResizeSave
{
using var original = SKBitmap.Decode(input);
this.IncreaseTotalMegapixels(original.Width, original.Height);
(int width, int height) scaled = this.ScaledSize(original.Width, original.Height, ThumbnailSize);
using var surface = SKSurface.Create(new SKImageInfo(scaled.width, scaled.height, original.ColorType, original.AlphaType));
(int Width, int Height) scaled = this.ScaledSize(original.Width, original.Height, 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;
canvas.Scale((float)scaled.width / original.Width);
canvas.Scale((float)scaled.Width / original.Width);
canvas.DrawBitmap(original, 0, 0, paint);
canvas.Flush();
@ -255,8 +255,8 @@ namespace SixLabors.ImageSharp.Benchmarks.LoadResizeSave
{
using var original = SKBitmap.Decode(input);
this.IncreaseTotalMegapixels(original.Width, original.Height);
(int width, int height) scaled = this.ScaledSize(original.Width, original.Height, ThumbnailSize);
using var resized = original.Resize(new SKImageInfo(scaled.width, scaled.height), SKFilterQuality.High);
(int Width, int Height) scaled = this.ScaledSize(original.Width, original.Height, ThumbnailSize);
using var resized = original.Resize(new SKImageInfo(scaled.Width, scaled.Height), SKFilterQuality.High);
if (resized == null)
{
return;

4
tests/ImageSharp.Tests.ProfilingSandbox/LoadResizeSaveParallelMemoryStress.cs

@ -1,4 +1,4 @@
// Copyright (c) Six Labors.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
@ -120,7 +120,7 @@ namespace SixLabors.ImageSharp.Tests.ProfilingSandbox
return bld.ToString();
static string L(string header) => new ('-', header.Length);
static string L(string header) => new('-', header.Length);
static string F(string column) => $"{{0,{column.Length}:f3}}";
}
}

3
tests/ImageSharp.Tests.ProfilingSandbox/Program.cs

@ -1,3 +1,6 @@
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using SixLabors.ImageSharp.Tests.Formats.Jpg;
using SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations;

Loading…
Cancel
Save