Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
98 changes: 49 additions & 49 deletions tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ public void TiffDecoder_CanDecode_12Bit_WithUnassociatedAlpha<TPixel>(TestImageP
public void TiffDecoder_CanDecode_12Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }

TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.264F);
}
Expand Down Expand Up @@ -258,13 +258,13 @@ public void TiffDecoder_CanDecode_20Bit_WithAssociatedAlpha<TPixel>(TestImagePro

where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }

TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.376F);
}
Expand All @@ -284,13 +284,13 @@ public void TiffDecoder_CanDecode_24Bit_WithUnassociatedAlpha<TPixel>(TestImageP
public void TiffDecoder_CanDecode_24Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }

TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.405F);
}
Expand Down Expand Up @@ -385,13 +385,13 @@ public void TiffDecoder_CanDecode_32Bit_WithUnassociatedAlpha<TPixel>(TestImageP
public void TiffDecoder_CanDecode_32Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }

// Note: Using tolerant comparer here, because there is a small difference to the reference decoder probably due to floating point rounding issues.
TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.004F);
Expand Down Expand Up @@ -425,13 +425,13 @@ public void TiffDecoder_CanDecode_40Bit_WithUnassociatedAlpha<TPixel>(TestImageP
public void TiffDecoder_CanDecode_40Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }

TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.247F);
}
Expand Down Expand Up @@ -463,13 +463,13 @@ public void TiffDecoder_CanDecode_48Bit_WithUnassociatedAlpha<TPixel>(TestImageP
public void TiffDecoder_CanDecode_48Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }

TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.118F);
}
Expand All @@ -492,13 +492,13 @@ public void TiffDecoder_CanDecode_56Bit_WithUnassociatedAlpha<TPixel>(TestImageP
public void TiffDecoder_CanDecode_56Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }

TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.075F);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class ResizeTests
};

private static readonly ImageComparer ValidatorComparer =
ImageComparer.TolerantPercentage(TestEnvironment.IsMacOS && TestEnvironment.RunsOnCI ? 0.26F : 0.07F);
ImageComparer.TolerantPercentage(0.07F);

[Fact]
public void Resize_PixelAgnostic()
Expand Down