Skip to content

Commit f20a165

Browse files
committed
Only DebugSave testimages with bit depth >= 24
1 parent 8f1e43a commit f20a165

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,12 @@ public void TiffDecoder_CanDecode_16Bit_Gray<TPixel>(TestImageProvider<TPixel> p
159159
[WithFile(Flower24BitGray, PixelTypes.Rgba32)]
160160
[WithFile(Flower24BitGrayLittleEndian, PixelTypes.Rgba32)]
161161
public void TiffDecoder_CanDecode_24Bit_Gray<TPixel>(TestImageProvider<TPixel> provider)
162-
where TPixel : unmanaged, IPixel<TPixel> => TestTiffDecoder(provider);
162+
where TPixel : unmanaged, IPixel<TPixel>
163+
{
164+
// Note: because the MagickReferenceDecoder fails to load the image, we only debug save them.
165+
using Image<TPixel> image = provider.GetImage();
166+
image.DebugSave(provider);
167+
}
163168

164169
[Theory]
165170
[WithFile(FlowerRgb101010Contiguous, PixelTypes.Rgba32)]
@@ -171,7 +176,12 @@ public void TiffDecoder_CanDecode_30Bit<TPixel>(TestImageProvider<TPixel> provid
171176
[WithFile(Flower32BitGray, PixelTypes.Rgba32)]
172177
[WithFile(Flower32BitGrayLittleEndian, PixelTypes.Rgba32)]
173178
public void TiffDecoder_CanDecode_32Bit_Gray<TPixel>(TestImageProvider<TPixel> provider)
174-
where TPixel : unmanaged, IPixel<TPixel> => TestTiffDecoder(provider);
179+
where TPixel : unmanaged, IPixel<TPixel>
180+
{
181+
// Note: because the MagickReferenceDecoder fails to load the image, we only debug save them.
182+
using Image<TPixel> image = provider.GetImage();
183+
image.DebugSave(provider);
184+
}
175185

176186
[Theory]
177187
[WithFile(FlowerRgb121212Contiguous, PixelTypes.Rgba32)]
@@ -199,15 +209,25 @@ public void TiffDecoder_CanDecode_48Bit<TPixel>(TestImageProvider<TPixel> provid
199209
[WithFile(FlowerRgb242424Planar, PixelTypes.Rgba32)]
200210
[WithFile(FlowerRgb242424PlanarLittleEndian, PixelTypes.Rgba32)]
201211
public void TiffDecoder_CanDecode_72Bit<TPixel>(TestImageProvider<TPixel> provider)
202-
where TPixel : unmanaged, IPixel<TPixel> => TestTiffDecoder(provider);
212+
where TPixel : unmanaged, IPixel<TPixel>
213+
{
214+
// Note: because the MagickReferenceDecoder fails to load the image, we only debug save them.
215+
using Image<TPixel> image = provider.GetImage();
216+
image.DebugSave(provider);
217+
}
203218

204219
[Theory]
205220
[WithFile(FlowerRgb323232Contiguous, PixelTypes.Rgba32)]
206221
[WithFile(FlowerRgb323232ContiguousLittleEndian, PixelTypes.Rgba32)]
207222
[WithFile(FlowerRgb323232Planar, PixelTypes.Rgba32)]
208223
[WithFile(FlowerRgb323232PlanarLittleEndian, PixelTypes.Rgba32)]
209224
public void TiffDecoder_CanDecode_96Bit<TPixel>(TestImageProvider<TPixel> provider)
210-
where TPixel : unmanaged, IPixel<TPixel> => TestTiffDecoder(provider);
225+
where TPixel : unmanaged, IPixel<TPixel>
226+
{
227+
// Note: because the MagickReferenceDecoder fails to load the image, we only debug save them.
228+
using Image<TPixel> image = provider.GetImage();
229+
image.DebugSave(provider);
230+
}
211231

212232
[Theory]
213233
[WithFile(GrayscaleDeflateMultistrip, PixelTypes.Rgba32)]

0 commit comments

Comments
 (0)