Browse Source

Add TIFF as a default image format

pull/1570/head
Andrew Wilkinson 9 years ago
parent
commit
06ed5221c4
  1. 1
      src/ImageSharp/Configuration.cs
  2. 12
      tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/TiffDecoderHeaderTests.cs

1
src/ImageSharp/Configuration.cs

@ -109,6 +109,7 @@ namespace ImageSharp
config.AddImageFormat(new Formats.JpegFormat());
config.AddImageFormat(new Formats.GifFormat());
config.AddImageFormat(new Formats.BmpFormat());
config.AddImageFormat(new Formats.TiffFormat());
return config;
}

12
tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/TiffDecoderHeaderTests.cs

@ -68,7 +68,7 @@ namespace ImageSharp.Tests
TiffDecoder decoder = new TiffDecoder();
ImageFormatException e = Assert.Throws<ImageFormatException>(() => { TestDecode(decoder, stream); });
ImageFormatException e = Assert.Throws<ImageFormatException>(() => { decoder.Decode<Rgba32>(Configuration.Default, stream, null); });
Assert.Equal("Invalid TIFF file header.", e.Message);
}
@ -86,7 +86,7 @@ namespace ImageSharp.Tests
TiffDecoder decoder = new TiffDecoder();
ImageFormatException e = Assert.Throws<ImageFormatException>(() => { TestDecode(decoder, stream); });
ImageFormatException e = Assert.Throws<ImageFormatException>(() => { decoder.Decode<Rgba32>(Configuration.Default, stream, null); });
Assert.Equal("Invalid TIFF file header.", e.Message);
}
@ -103,15 +103,9 @@ namespace ImageSharp.Tests
TiffDecoder decoder = new TiffDecoder();
ImageFormatException e = Assert.Throws<ImageFormatException>(() => { TestDecode(decoder, stream); });
ImageFormatException e = Assert.Throws<ImageFormatException>(() => { decoder.Decode<Rgba32>(Configuration.Default, stream, null); });
Assert.Equal("Invalid TIFF file header.", e.Message);
}
private void TestDecode(TiffDecoder decoder, Stream stream)
{
Configuration.Default.AddImageFormat(new TiffFormat());
Image<Rgba32> image = decoder.Decode<Rgba32>(Configuration.Default, stream, null);
}
}
}
Loading…
Cancel
Save