Browse Source

Merge branch 'pgm-support' of https://github.com/ynse01/ImageSharp into pgm-support

pull/1851/head
Ynse Hoornenborg 4 years ago
parent
commit
5587770eef
  1. 2
      src/ImageSharp/Formats/Jpeg/JpegDecoder.cs
  2. 8
      tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs

2
src/ImageSharp/Formats/Jpeg/JpegDecoder.cs

@ -42,7 +42,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <inheritdoc />
public async Task<Image> DecodeAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken)
=> await this.DecodeAsync<Rgba32>(configuration, stream, cancellationToken)
=> await this.DecodeAsync<Rgb24>(configuration, stream, cancellationToken)
.ConfigureAwait(false);
/// <inheritdoc/>

8
tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs

@ -93,6 +93,14 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
Assert.IsType<Image<Rgb24>>(image);
}
[Fact]
public async Task DecodeAsync_NonGeneric_CreatesRgb24Image()
{
string file = Path.Combine(TestEnvironment.InputImagesDirectoryFullPath, TestImages.Jpeg.Baseline.Jpeg420Small);
using Image image = await Image.LoadAsync(file);
Assert.IsType<Image<Rgb24>>(image);
}
[Theory]
[WithFile(TestImages.Jpeg.Baseline.Calliphora, CommonNonDefaultPixelTypes)]
public void JpegDecoder_IsNotBoundToSinglePixelType<TPixel>(TestImageProvider<TPixel> provider)

Loading…
Cancel
Save