|
|
|
@ -181,17 +181,13 @@ namespace SixLabors.ImageSharp.Tests.Formats.Bmp |
|
|
|
BmpBitsPerPixel bitsPerPixel) |
|
|
|
where TPixel : unmanaged, IPixel<TPixel> |
|
|
|
{ |
|
|
|
// The Magick Reference Decoder can not decode 4-Bit bitmaps, so only execute this on windows.
|
|
|
|
if (TestEnvironment.IsWindows) |
|
|
|
{ |
|
|
|
// Oddly the difference only happens locally but we'll not test for that.
|
|
|
|
// I suspect the issue is with the reference codec.
|
|
|
|
ImageComparer comparer = TestEnvironment.IsFramework |
|
|
|
? ImageComparer.TolerantPercentage(0.0161F) |
|
|
|
: ImageComparer.Exact; |
|
|
|
// Oddly the difference only happens locally but we'll not test for that.
|
|
|
|
// I suspect the issue is with the reference codec.
|
|
|
|
ImageComparer comparer = TestEnvironment.IsFramework |
|
|
|
? ImageComparer.TolerantPercentage(0.0161F) |
|
|
|
: ImageComparer.Exact; |
|
|
|
|
|
|
|
TestBmpEncoderCore(provider, bitsPerPixel, supportTransparency: false, customComparer: comparer); |
|
|
|
} |
|
|
|
TestBmpEncoderCore(provider, bitsPerPixel, supportTransparency: false, customComparer: comparer); |
|
|
|
} |
|
|
|
|
|
|
|
[Theory] |
|
|
|
@ -201,17 +197,13 @@ namespace SixLabors.ImageSharp.Tests.Formats.Bmp |
|
|
|
BmpBitsPerPixel bitsPerPixel) |
|
|
|
where TPixel : unmanaged, IPixel<TPixel> |
|
|
|
{ |
|
|
|
// The Magick Reference Decoder can not decode 4-Bit bitmaps, so only execute this on windows.
|
|
|
|
if (TestEnvironment.IsWindows) |
|
|
|
{ |
|
|
|
// Oddly the difference only happens locally but we'll not test for that.
|
|
|
|
// I suspect the issue is with the reference codec.
|
|
|
|
ImageComparer comparer = TestEnvironment.IsFramework |
|
|
|
? ImageComparer.TolerantPercentage(0.0161F) |
|
|
|
: ImageComparer.Exact; |
|
|
|
// Oddly the difference only happens locally but we'll not test for that.
|
|
|
|
// I suspect the issue is with the reference codec.
|
|
|
|
ImageComparer comparer = TestEnvironment.IsFramework |
|
|
|
? ImageComparer.TolerantPercentage(0.0161F) |
|
|
|
: ImageComparer.Exact; |
|
|
|
|
|
|
|
TestBmpEncoderCore(provider, bitsPerPixel, supportTransparency: true, customComparer: comparer); |
|
|
|
} |
|
|
|
TestBmpEncoderCore(provider, bitsPerPixel, supportTransparency: true, customComparer: comparer); |
|
|
|
} |
|
|
|
|
|
|
|
[Theory] |
|
|
|
@ -219,28 +211,14 @@ namespace SixLabors.ImageSharp.Tests.Formats.Bmp |
|
|
|
public void Encode_1Bit_WithV3Header_Works<TPixel>( |
|
|
|
TestImageProvider<TPixel> provider, |
|
|
|
BmpBitsPerPixel bitsPerPixel) |
|
|
|
where TPixel : unmanaged, IPixel<TPixel> |
|
|
|
{ |
|
|
|
// The Magick Reference Decoder can not decode 1-Bit bitmaps, so only execute this on windows.
|
|
|
|
if (TestEnvironment.IsWindows) |
|
|
|
{ |
|
|
|
TestBmpEncoderCore(provider, bitsPerPixel, supportTransparency: false); |
|
|
|
} |
|
|
|
} |
|
|
|
where TPixel : unmanaged, IPixel<TPixel> => TestBmpEncoderCore(provider, bitsPerPixel, supportTransparency: false); |
|
|
|
|
|
|
|
[Theory] |
|
|
|
[WithFile(Bit1, PixelTypes.Rgba32, BmpBitsPerPixel.Pixel1)] |
|
|
|
public void Encode_1Bit_WithV4Header_Works<TPixel>( |
|
|
|
TestImageProvider<TPixel> provider, |
|
|
|
BmpBitsPerPixel bitsPerPixel) |
|
|
|
where TPixel : unmanaged, IPixel<TPixel> |
|
|
|
{ |
|
|
|
// The Magick Reference Decoder can not decode 1-Bit bitmaps, so only execute this on windows.
|
|
|
|
if (TestEnvironment.IsWindows) |
|
|
|
{ |
|
|
|
TestBmpEncoderCore(provider, bitsPerPixel, supportTransparency: true); |
|
|
|
} |
|
|
|
} |
|
|
|
where TPixel : unmanaged, IPixel<TPixel> => TestBmpEncoderCore(provider, bitsPerPixel, supportTransparency: true); |
|
|
|
|
|
|
|
[Theory] |
|
|
|
[WithFile(Bit8Gs, PixelTypes.L8, BmpBitsPerPixel.Pixel8)] |
|
|
|
|