Browse Source
Merge branch 'master' into pgm-support
pull/1851/head
James Jackson-South
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
9 additions and
1 deletions
-
src/ImageSharp/Formats/Jpeg/JpegDecoder.cs
-
tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.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/>
|
|
|
|
|
|
|
|
@ -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) |
|
|
|
|