Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4 : Rewrite ChunkedMemoryStream #2838

Merged
merged 18 commits into from
Nov 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix #2779 buffer overrun
JimBobSquarePants committed Oct 16, 2024
commit 911480d6ebc43e006aa1a0a5038afcb9c9642e04
9 changes: 5 additions & 4 deletions src/ImageSharp/Image.WrapMemory.cs
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ public static Image<TPixel> WrapMemory<TPixel>(
{
Guard.NotNull(configuration, nameof(configuration));
Guard.NotNull(metadata, nameof(metadata));
Guard.IsTrue(pixelMemory.Length >= width * height, nameof(pixelMemory), "The length of the input memory is less than the specified image size");
Guard.IsTrue(pixelMemory.Length >= (long)width * height, nameof(pixelMemory), "The length of the input memory is less than the specified image size");

MemoryGroup<TPixel> memorySource = MemoryGroup<TPixel>.Wrap(pixelMemory);
return new Image<TPixel>(configuration, memorySource, width, height, metadata);
@@ -145,7 +145,7 @@ public static Image<TPixel> WrapMemory<TPixel>(
{
Guard.NotNull(configuration, nameof(configuration));
Guard.NotNull(metadata, nameof(metadata));
Guard.IsTrue(pixelMemoryOwner.Memory.Length >= width * height, nameof(pixelMemoryOwner), "The length of the input memory is less than the specified image size");
Guard.IsTrue(pixelMemoryOwner.Memory.Length >= (long)width * height, nameof(pixelMemoryOwner), "The length of the input memory is less than the specified image size");

MemoryGroup<TPixel> memorySource = MemoryGroup<TPixel>.Wrap(pixelMemoryOwner);
return new Image<TPixel>(configuration, memorySource, width, height, metadata);
@@ -232,7 +232,7 @@ public static Image<TPixel> WrapMemory<TPixel>(

ByteMemoryManager<TPixel> memoryManager = new(byteMemory);

Guard.IsTrue(memoryManager.Memory.Length >= width * height, nameof(byteMemory), "The length of the input memory is less than the specified image size");
Guard.IsTrue(memoryManager.Memory.Length >= (long)width * height, nameof(byteMemory), "The length of the input memory is less than the specified image size");

MemoryGroup<TPixel> memorySource = MemoryGroup<TPixel>.Wrap(memoryManager.Memory);
return new Image<TPixel>(configuration, memorySource, width, height, metadata);
@@ -422,10 +422,11 @@ public static unsafe Image<TPixel> WrapMemory<TPixel>(
Guard.IsFalse(pointer == null, nameof(pointer), "Pointer must be not null");
Guard.NotNull(configuration, nameof(configuration));
Guard.NotNull(metadata, nameof(metadata));
Guard.MustBeLessThanOrEqualTo(height * (long)width, int.MaxValue, "Total amount of pixels exceeds int.MaxValue");

UnmanagedMemoryManager<TPixel> memoryManager = new(pointer, width * height);

Guard.MustBeGreaterThanOrEqualTo(bufferSizeInBytes, memoryManager.Memory.Span.Length, nameof(bufferSizeInBytes));
Guard.MustBeGreaterThanOrEqualTo(bufferSizeInBytes / sizeof(TPixel), memoryManager.Memory.Span.Length, nameof(bufferSizeInBytes));

MemoryGroup<TPixel> memorySource = MemoryGroup<TPixel>.Wrap(memoryManager.Memory);
return new Image<TPixel>(configuration, memorySource, width, height, metadata);
30 changes: 21 additions & 9 deletions tests/ImageSharp.Tests/Image/ImageTests.WrapMemory.cs
Original file line number Diff line number Diff line change
@@ -294,8 +294,11 @@ public void WrapSystemDrawingBitmap_FromBytes_WhenObserved()
}
}

[Fact]
public unsafe void WrapMemory_Throws_OnTooLessWrongSize()
[Theory]
[InlineData(20, 5, 5)]
[InlineData(1023, 32, 32)]
[InlineData(65536, 65537, 65536)]
public unsafe void WrapMemory_Throws_OnTooLessWrongSize(int size, int width, int height)
{
var cfg = Configuration.CreateDefaultInstance();
var metaData = new ImageMetadata();
@@ -306,7 +309,7 @@ public unsafe void WrapMemory_Throws_OnTooLessWrongSize()
{
try
{
using var image = Image.WrapMemory<Rgba32>(cfg, ptr, 24, 5, 5, metaData);
using var image = Image.WrapMemory<Rgba32>(cfg, ptr, size * sizeof(Rgba32), width, height, metaData);
}
catch (Exception e)
{
@@ -317,24 +320,30 @@ public unsafe void WrapMemory_Throws_OnTooLessWrongSize()
Assert.IsType<ArgumentOutOfRangeException>(thrownException);
}

[Fact]
public unsafe void WrapMemory_FromPointer_CreatedImageIsCorrect()
[Theory]
[InlineData(25, 5, 5)]
[InlineData(26, 5, 5)]
[InlineData(2, 1, 1)]
[InlineData(1024, 32, 32)]
[InlineData(2048, 32, 32)]
public unsafe void WrapMemory_FromPointer_CreatedImageIsCorrect(int size, int width, int height)
{
var cfg = Configuration.CreateDefaultInstance();
var metaData = new ImageMetadata();

var array = new Rgba32[25];
var array = new Rgba32[size];

fixed (void* ptr = array)
{
using (var image = Image.WrapMemory<Rgba32>(cfg, ptr, 25, 5, 5, metaData))
using (var image = Image.WrapMemory<Rgba32>(cfg, ptr, size * sizeof(Rgba32), width, height, metaData))
{
Assert.True(image.DangerousTryGetSinglePixelMemory(out Memory<Rgba32> imageMem));
Span<Rgba32> imageSpan = imageMem.Span;
Span<Rgba32> sourceSpan = array.AsSpan(0, width * height);
ref Rgba32 pixel0 = ref imageSpan[0];
Assert.True(Unsafe.AreSame(ref array[0], ref pixel0));
Assert.True(Unsafe.AreSame(ref sourceSpan[0], ref pixel0));
ref Rgba32 pixel_1 = ref imageSpan[imageSpan.Length - 1];
Assert.True(Unsafe.AreSame(ref array[array.Length - 1], ref pixel_1));
Assert.True(Unsafe.AreSame(ref sourceSpan[sourceSpan.Length - 1], ref pixel_1));

Assert.Equal(cfg, image.Configuration);
Assert.Equal(metaData, image.Metadata);
@@ -395,6 +404,7 @@ public unsafe void WrapSystemDrawingBitmap_FromPointer()
[InlineData(0, 5, 5)]
[InlineData(20, 5, 5)]
[InlineData(1023, 32, 32)]
[InlineData(65536, 65537, 65536)]
public void WrapMemory_MemoryOfT_InvalidSize(int size, int height, int width)
{
var array = new Rgba32[size];
@@ -430,6 +440,7 @@ private class TestMemoryOwner<T> : IMemoryOwner<T>
[InlineData(0, 5, 5)]
[InlineData(20, 5, 5)]
[InlineData(1023, 32, 32)]
[InlineData(65536, 65537, 65536)]
public void WrapMemory_IMemoryOwnerOfT_InvalidSize(int size, int height, int width)
{
var array = new Rgba32[size];
@@ -476,6 +487,7 @@ public void WrapMemory_IMemoryOwnerOfT_ValidSize(int size, int height, int width
[InlineData(0, 5, 5)]
[InlineData(20, 5, 5)]
[InlineData(1023, 32, 32)]
[InlineData(65536, 65537, 65536)]
public void WrapMemory_IMemoryOwnerOfByte_InvalidSize(int size, int height, int width)
{
var array = new byte[size * Unsafe.SizeOf<Rgba32>()];

Unchanged files with check annotations Beta

public abstract class SIMDBenchmarkBase<T>
where T : struct
{
protected T[] input;

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected T[] result;

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected T testValue;

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected Vector<T> testVector;

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected virtual T GetTestValue() => default;
public abstract class FromVector4<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
{
protected IMemoryOwner<Vector4> source;

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected IMemoryOwner<TPixel> destination;

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected Configuration Configuration => Configuration.Default;
public abstract class ToVector4<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
{
protected IMemoryOwner<TPixel> source;

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected IMemoryOwner<Vector4> destination;

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected Configuration Configuration => Configuration.Default;
public abstract class Resize<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
{
private byte[] bytes = null;

Check warning on line 19 in tests/ImageSharp.Benchmarks/Processing/Resize.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Member 'bytes' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Processing/Resize.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Member 'bytes' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Processing/Resize.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Member 'bytes' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Processing/Resize.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Member 'bytes' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Processing/Resize.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Member 'bytes' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Processing/Resize.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Member 'bytes' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)
private Image<TPixel> sourceImage;
// Set the quality for ImagSharp
private readonly JpegEncoder imageSharpJpegEncoder = new() { Quality = Quality };
private readonly ImageCodecInfo systemDrawingJpegCodec =
ImageCodecInfo.GetImageEncoders().First(codec => codec.FormatID == ImageFormat.Jpeg.Guid);

Check warning on line 36 in tests/ImageSharp.Benchmarks/LoadResizeSave/LoadResizeSaveStressRunner.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

This call site is reachable on all platforms. 'ImageFormat.Guid' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 36 in tests/ImageSharp.Benchmarks/LoadResizeSave/LoadResizeSaveStressRunner.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

This call site is reachable on all platforms. 'ImageCodecInfo.GetImageEncoders()' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
public string[] Images { get; private set; }