Skip to content

Undo horizontal prediction for each tile row in case of tiled tiff's #2878

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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f72be91
Undo horizontal prediction for each tile row in case of tiled tiff's
brianpopow Feb 2, 2025
e186c52
Add test case for tiled tiff, deflate compressed with predictor
brianpopow Feb 3, 2025
787e04d
Add test case for tiled tiff, deflate compressed with predictor and c…
brianpopow Feb 4, 2025
e3c7471
Add test case for tiled gray tiff, deflate compressed with predictor
brianpopow Feb 6, 2025
f11fbc1
Add test cases for tiled 16 bit gray tiff's
brianpopow Feb 8, 2025
47c6755
Add test cases for tiled 32 bit gray tiff's
brianpopow Feb 9, 2025
97133fe
Add test cases for tiled tiff, deflate compressed with predictor and …
brianpopow Feb 9, 2025
f804ca2
Add test cases for tiled tiff, deflate compressed with predictor and …
brianpopow Feb 9, 2025
dacb713
Add test cases for tiled tiff, deflate compressed with predictor and …
brianpopow Feb 10, 2025
dec1dc1
Add test cases for tiled tiff, deflate compressed with predictor and …
brianpopow Feb 11, 2025
9954f50
Merge remote-tracking branch 'origin/main' into bp/Issue2877
brianpopow Feb 14, 2025
71f7d86
Add method UndoTile in HorizontalPredictor
brianpopow Feb 19, 2025
5cfa2bc
Enable 32 bits per channel decoding for MagickReferenceDecoder
brianpopow Feb 19, 2025
0a52ee7
Try fix build issue with ubuntu latest and net9.0
brianpopow Feb 20, 2025
7a5be72
Add test cases for tiled lzw compressed images
brianpopow Feb 20, 2025
8f97280
Add tiled rgba 16 bit each channel test files
brianpopow Feb 20, 2025
18f8de9
Do not ignore tileHeight when undoing horizontal predictor
brianpopow Feb 22, 2025
23cfdd2
Better test images for tiled tiff: tile width and height is not the same
brianpopow Feb 23, 2025
85c7ed2
Merge branch 'main' into bp/Issue2877
JimBobSquarePants Apr 7, 2025
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
Original file line number Diff line number Diff line change
@@ -22,6 +22,12 @@ internal sealed class DeflateTiffCompression : TiffBaseDecompressor

private readonly TiffColorType colorType;

private readonly bool isTiled;

private readonly int tileWidth;

private readonly int tileHeight;

/// <summary>
/// Initializes a new instance of the <see cref="DeflateTiffCompression" /> class.
/// </summary>
@@ -31,11 +37,17 @@ internal sealed class DeflateTiffCompression : TiffBaseDecompressor
/// <param name="colorType">The color type of the pixel data.</param>
/// <param name="predictor">The tiff predictor used.</param>
/// <param name="isBigEndian">if set to <c>true</c> decodes the pixel data as big endian, otherwise as little endian.</param>
public DeflateTiffCompression(MemoryAllocator memoryAllocator, int width, int bitsPerPixel, TiffColorType colorType, TiffPredictor predictor, bool isBigEndian)
/// <param name="isTiled">Flag indicates, if the image is a tiled image.</param>
/// <param name="tileWidth">Number of pixels in a tile row.</param>
/// <param name="tileHeight">Number of rows in a tile.</param>
public DeflateTiffCompression(MemoryAllocator memoryAllocator, int width, int bitsPerPixel, TiffColorType colorType, TiffPredictor predictor, bool isBigEndian, bool isTiled, int tileWidth, int tileHeight)
: base(memoryAllocator, width, bitsPerPixel, predictor)
{
this.colorType = colorType;
this.isBigEndian = isBigEndian;
this.isTiled = isTiled;
this.tileWidth = tileWidth;
this.tileHeight = tileHeight;
}

/// <inheritdoc/>
@@ -70,7 +82,15 @@ protected override void Decompress(BufferedReadStream stream, int byteCount, int

if (this.Predictor == TiffPredictor.Horizontal)
{
HorizontalPredictor.Undo(buffer, this.Width, this.colorType, this.isBigEndian);
if (this.isTiled)
{
// When the image is tiled, undoing the horizontal predictor will be done for each tile row.
HorizontalPredictor.UndoTile(buffer, this.tileWidth, this.tileHeight, this.colorType, this.isBigEndian);
}
else
{
HorizontalPredictor.Undo(buffer, this.Width, this.colorType, this.isBigEndian);
}
}
}

Original file line number Diff line number Diff line change
@@ -17,6 +17,12 @@ internal sealed class LzwTiffCompression : TiffBaseDecompressor

private readonly TiffColorType colorType;

private readonly bool isTiled;

private readonly int tileWidth;

private readonly int tileHeight;

/// <summary>
/// Initializes a new instance of the <see cref="LzwTiffCompression" /> class.
/// </summary>
@@ -26,11 +32,17 @@ internal sealed class LzwTiffCompression : TiffBaseDecompressor
/// <param name="colorType">The color type of the pixel data.</param>
/// <param name="predictor">The tiff predictor used.</param>
/// <param name="isBigEndian">if set to <c>true</c> decodes the pixel data as big endian, otherwise as little endian.</param>
public LzwTiffCompression(MemoryAllocator memoryAllocator, int width, int bitsPerPixel, TiffColorType colorType, TiffPredictor predictor, bool isBigEndian)
/// <param name="isTiled">Flag indicates, if the image is a tiled image.</param>
/// <param name="tileWidth">Number of pixels in a tile row.</param>
/// <param name="tileHeight">Number of rows in a tile.</param>
public LzwTiffCompression(MemoryAllocator memoryAllocator, int width, int bitsPerPixel, TiffColorType colorType, TiffPredictor predictor, bool isBigEndian, bool isTiled, int tileWidth, int tileHeight)
: base(memoryAllocator, width, bitsPerPixel, predictor)
{
this.colorType = colorType;
this.isBigEndian = isBigEndian;
this.isTiled = isTiled;
this.tileWidth = tileWidth;
this.tileHeight = tileHeight;
}

/// <inheritdoc/>
@@ -41,7 +53,15 @@ protected override void Decompress(BufferedReadStream stream, int byteCount, int

if (this.Predictor == TiffPredictor.Horizontal)
{
HorizontalPredictor.Undo(buffer, this.Width, this.colorType, this.isBigEndian);
if (this.isTiled)
{
// When the image is tiled, undoing the horizontal predictor will be done for each tile row.
HorizontalPredictor.UndoTile(buffer, this.tileWidth, this.tileHeight, this.colorType, this.isBigEndian);
}
else
{
HorizontalPredictor.Undo(buffer, this.Width, this.colorType, this.isBigEndian);
}
}
}

Loading

Unchanged files with check annotations Beta

{
private class BlankProvider : TestImageProvider<TPixel>, IXunitSerializable
{
public BlankProvider(int width, int height)

Check warning on line 15 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs

GitHub Actions / Build (false, ubuntu-latest, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 15 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 15 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 15 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs

GitHub Actions / Build (false, windows-latest, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 15 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs

GitHub Actions / Build (false, macos-13, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 15 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'
{
this.Width = width;
this.Height = height;
/// <summary>
/// This parameterless constructor is needed for xUnit deserialization
/// </summary>
public BlankProvider()

Check warning on line 24 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 24 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 24 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs

GitHub Actions / Build (false, windows-latest, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 24 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs

GitHub Actions / Build (false, macos-13, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 24 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'
{
this.Width = 100;
this.Height = 100;
{
if (expectedColor != rowSpan[x])
{
var xx = 0;

Check warning on line 124 in tests/ImageSharp.Tests/Formats/Icon/Cur/CurEncoderTests.cs

GitHub Actions / Build (false, ubuntu-latest, net8.0, 8.0.x, -x64, false)

The variable 'xx' is assigned but its value is never used

Check warning on line 124 in tests/ImageSharp.Tests/Formats/Icon/Cur/CurEncoderTests.cs

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

The variable 'xx' is assigned but its value is never used

Check warning on line 124 in tests/ImageSharp.Tests/Formats/Icon/Cur/CurEncoderTests.cs

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

The variable 'xx' is assigned but its value is never used

Check warning on line 124 in tests/ImageSharp.Tests/Formats/Icon/Cur/CurEncoderTests.cs

GitHub Actions / Build (false, windows-latest, net8.0, 8.0.x, -x64, false)

The variable 'xx' is assigned but its value is never used

Check warning on line 124 in tests/ImageSharp.Tests/Formats/Icon/Cur/CurEncoderTests.cs

GitHub Actions / Build (false, macos-13, net8.0, 8.0.x, -x64, false)

The variable 'xx' is assigned but its value is never used

Check warning on line 124 in tests/ImageSharp.Tests/Formats/Icon/Cur/CurEncoderTests.cs

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

The variable 'xx' is assigned but its value is never used
}
// Needed for deserialization!
// ReSharper disable once UnusedMember.Local
public FileProvider()

Check warning on line 163 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs

GitHub Actions / Build (false, ubuntu-latest, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 163 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 163 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 163 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs

GitHub Actions / Build (false, windows-latest, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 163 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs

GitHub Actions / Build (false, macos-13, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 163 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'
{
}
public FileProvider(string filePath) => this.FilePath = filePath;

Check warning on line 167 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs

GitHub Actions / Build (false, ubuntu-latest, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 167 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 167 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 167 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs

GitHub Actions / Build (false, windows-latest, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 167 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs

GitHub Actions / Build (false, macos-13, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 167 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'
/// <summary>
/// Gets the file path relative to the "~/tests/images" folder
private string methodName;
private Func<Image<TPixel>> factoryFunc;
public MemberMethodProvider()

Check warning on line 23 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs

GitHub Actions / Build (false, ubuntu-latest, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 23 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 23 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 23 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs

GitHub Actions / Build (false, windows-latest, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 23 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs

GitHub Actions / Build (false, macos-13, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 23 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'
{
}
public MemberMethodProvider(string declaringTypeName, string methodName)

Check warning on line 27 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs

GitHub Actions / Build (false, ubuntu-latest, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 27 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 27 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 27 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs

GitHub Actions / Build (false, windows-latest, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 27 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs

GitHub Actions / Build (false, macos-13, net8.0, 8.0.x, -x64, false)

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'

Check warning on line 27 in tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs

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

'TestImageProvider<TPixel>.TestImageProvider()' is obsolete: 'Called by the de-serializer; should only be called by deriving classes for de-serialization purposes'
{
this.declaringTypeName = declaringTypeName;
this.methodName = methodName;
public int HeaderSize => 1;
public bool TryDetectFormat(ReadOnlySpan<byte> header, [NotNullWhen(true)] out IImageFormat? format)

Check warning on line 21 in tests/ImageSharp.Tests/Image/MockImageFormatDetector.cs

GitHub Actions / Build (false, ubuntu-latest, net8.0, 8.0.x, -x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 21 in tests/ImageSharp.Tests/Image/MockImageFormatDetector.cs

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

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 21 in tests/ImageSharp.Tests/Image/MockImageFormatDetector.cs

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

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 21 in tests/ImageSharp.Tests/Image/MockImageFormatDetector.cs

GitHub Actions / Build (false, windows-latest, net8.0, 8.0.x, -x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 21 in tests/ImageSharp.Tests/Image/MockImageFormatDetector.cs

GitHub Actions / Build (false, macos-13, net8.0, 8.0.x, -x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 21 in tests/ImageSharp.Tests/Image/MockImageFormatDetector.cs

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

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
format = this.localImageFormatMock;
public int HeaderSize => this.testFormat.HeaderSize;
public bool TryDetectFormat(ReadOnlySpan<byte> header, [NotNullWhen(true)] out IImageFormat? format)

Check warning on line 180 in tests/ImageSharp.Tests/TestFormat.cs

GitHub Actions / Build (false, ubuntu-latest, net8.0, 8.0.x, -x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 180 in tests/ImageSharp.Tests/TestFormat.cs

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

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 180 in tests/ImageSharp.Tests/TestFormat.cs

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

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 180 in tests/ImageSharp.Tests/TestFormat.cs

GitHub Actions / Build (false, windows-latest, net8.0, 8.0.x, -x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 180 in tests/ImageSharp.Tests/TestFormat.cs

GitHub Actions / Build (false, macos-13, net8.0, 8.0.x, -x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 180 in tests/ImageSharp.Tests/TestFormat.cs

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

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
format = this.testFormat.IsSupportedFileFormat(header) ? this.testFormat : null;
{
void FromRgba32(Rgba32 source);
static abstract T StaticFromRgba32(Rgba32 source);

Check warning on line 14 in tests/ImageSharp.Benchmarks/General/PixelConversion/ITestPixel.cs

GitHub Actions / Build (false, ubuntu-latest, net8.0, 8.0.x, -x64, false)

Do not declare static members on generic types (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1000)
void FromRgba32(ref Rgba32 source);
void FromVector4(Vector4 source);
static abstract T StaticFromVector4(Vector4 source);

Check warning on line 22 in tests/ImageSharp.Benchmarks/General/PixelConversion/ITestPixel.cs

GitHub Actions / Build (false, ubuntu-latest, net8.0, 8.0.x, -x64, false)

Do not declare static members on generic types (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1000)
void FromVector4(ref Vector4 source);
this.stream.Seek(this.readerPosition, SeekOrigin.Begin);
}
this.stream.Read(this.readBuffer, 0, BufferLength);

Check warning on line 199 in tests/ImageSharp.Benchmarks/General/IO/BufferedReadStreamWrapper.cs

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

Avoid inexact read with 'System.IO.Stream.Read(byte[], int, int)' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2022)

Check warning on line 199 in tests/ImageSharp.Benchmarks/General/IO/BufferedReadStreamWrapper.cs

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

Avoid inexact read with 'System.IO.Stream.Read(byte[], int, int)' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2022)

Check warning on line 199 in tests/ImageSharp.Benchmarks/General/IO/BufferedReadStreamWrapper.cs

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

Avoid inexact read with 'System.IO.Stream.Read(byte[], int, int)' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2022)
this.readBufferIndex = 0;
}
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using SixLabors.ImageSharp.Formats.Qoi;

Check warning on line 4 in tests/ImageSharp.Tests/Formats/Qoi/ImageExtensionsTest.cs

GitHub Actions / Build (false, windows-latest, net8.0, 8.0.x, -x64, false)

Using directives should be ordered alphabetically by the namespaces (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1210.md)

Check warning on line 4 in tests/ImageSharp.Tests/Formats/Qoi/ImageExtensionsTest.cs

GitHub Actions / Build (false, macos-13, net8.0, 8.0.x, -x64, false)

Using directives should be ordered alphabetically by the namespaces (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1210.md)
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats;