-
-
Notifications
You must be signed in to change notification settings - Fork 855
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduced OldJpegDecoder : IImageDecoder for the GolangPort decoder
- Loading branch information
1 parent
493deda
commit b3b4827
Showing
2 changed files
with
35 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
namespace ImageSharp.Formats.Jpeg.GolangPort | ||
{ | ||
using System.IO; | ||
|
||
using ImageSharp.PixelFormats; | ||
|
||
/// <summary> | ||
/// Image decoder for generating an image out of a jpg stream. | ||
/// </summary> | ||
public sealed class OldJpegDecoder : IImageDecoder, IJpegDecoderOptions | ||
{ | ||
/// <summary> | ||
/// Gets or sets a value indicating whether the metadata should be ignored when the image is being decoded. | ||
/// </summary> | ||
public bool IgnoreMetadata { get; set; } | ||
|
||
/// <inheritdoc/> | ||
public Image<TPixel> Decode<TPixel>(Configuration configuration, Stream stream) | ||
where TPixel : struct, IPixel<TPixel> | ||
{ | ||
Guard.NotNull(stream, nameof(stream)); | ||
|
||
using (var decoder = new OldJpegDecoderCore(configuration, this)) | ||
{ | ||
return decoder.Decode<TPixel>(stream); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters