Browse Source

Restore missing Guard

pull/1574/head
James Jackson-South 6 years ago
parent
commit
fed57b5418
  1. 7
      src/ImageSharp/Image.FromStream.cs
  2. 2
      tests/ImageSharp.Benchmarks/General/IO/BufferedReadStreamWrapper.cs

7
src/ImageSharp/Image.FromStream.cs

@ -292,7 +292,10 @@ namespace SixLabors.ImageSharp
/// <exception cref="InvalidImageContentException">Image contains invalid content.</exception>
/// <returns>A new <see cref="Image"/>.</returns>
public static Image Load(Configuration configuration, Stream stream, IImageDecoder decoder)
=> WithSeekableStream(configuration, stream, s => decoder.Decode(configuration, s));
{
Guard.NotNull(decoder, nameof(decoder));
return WithSeekableStream(configuration, stream, s => decoder.Decode(configuration, s));
}
/// <summary>
/// Decode a new instance of the <see cref="Image"/> class from the given stream.
@ -327,7 +330,7 @@ namespace SixLabors.ImageSharp
/// <exception cref="NotSupportedException">The stream is not readable.</exception>
/// <exception cref="UnknownImageFormatException">Image format not recognised.</exception>
/// <exception cref="InvalidImageContentException">Image contains invalid content.</exception>
/// <returns>A new <see cref="Image"/>.</returns>>
/// <returns>A new <see cref="Image"/>.</returns>
public static Image Load(Configuration configuration, Stream stream) => Load(configuration, stream, out _);
/// <summary>

2
tests/ImageSharp.Benchmarks/General/IO/BufferedReadStreamWrapper.cs

@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;

Loading…
Cancel
Save