diff --git a/src/ImageSharp/Formats/PixelTypeInfo.cs b/src/ImageSharp/Formats/PixelTypeInfo.cs
index c83ce6788..ed21b91bf 100644
--- a/src/ImageSharp/Formats/PixelTypeInfo.cs
+++ b/src/ImageSharp/Formats/PixelTypeInfo.cs
@@ -6,10 +6,10 @@ namespace SixLabors.ImageSharp.Formats
///
/// Contains information about the pixels that make up an images visual data.
///
- public readonly struct PixelTypeInfo
+ public class PixelTypeInfo
{
///
- /// Initializes a new instance of the struct.
+ /// Initializes a new instance of the class.
///
/// Color depth, in number of bits per pixel.
internal PixelTypeInfo(int bitsPerPixel)
diff --git a/tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs
index c15b0c2b0..d958278f6 100644
--- a/tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs
+++ b/tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs
@@ -57,7 +57,7 @@ namespace SixLabors.ImageSharp.Tests
var testFile = TestFile.Create(imagePath);
using (var stream = new MemoryStream(testFile.Bytes, false))
{
- Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType.BitsPerPixel);
+ Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType?.BitsPerPixel);
}
}
}
diff --git a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs
index 9cd29f460..9cdb9f8b1 100644
--- a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs
+++ b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs
@@ -172,7 +172,7 @@ namespace SixLabors.ImageSharp.Tests
TestFile testFile = TestFile.Create(imagePath);
using (var stream = new MemoryStream(testFile.Bytes, false))
{
- Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType.BitsPerPixel);
+ Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType?.BitsPerPixel);
}
}
diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
index c7ac71ed9..95ee40e80 100644
--- a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
+++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
@@ -397,10 +397,10 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
[InlineData(TestImages.Jpeg.Baseline.Snake, 24)]
public void DetectPixelSize(string imagePath, int expectedPixelSize)
{
- var testFile = TestFile.Create(imagePath);
+ TestFile testFile = TestFile.Create(imagePath);
using (var stream = new MemoryStream(testFile.Bytes, false))
{
- Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType.BitsPerPixel);
+ Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType?.BitsPerPixel);
}
}
}
diff --git a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs
index 8e83f5ffb..f70e4e330 100644
--- a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs
+++ b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs
@@ -228,10 +228,10 @@ namespace SixLabors.ImageSharp.Tests
[InlineData(TestImages.Png.Rgb48BppInterlaced, 48)]
public void DetectPixelSize(string imagePath, int expectedPixelSize)
{
- var testFile = TestFile.Create(imagePath);
+ TestFile testFile = TestFile.Create(imagePath);
using (var stream = new MemoryStream(testFile.Bytes, false))
{
- Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType.BitsPerPixel);
+ Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType?.BitsPerPixel);
}
}