Browse Source

Merge pull request #1573 from SixLabors/af/fix-overload

Image.Load(byte[]) should return non-generic Image
pull/1593/head
James Jackson-South 5 years ago
committed by GitHub
parent
commit
ae8e5e49e0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/ImageSharp/Image.FromBytes.cs
  2. 4
      tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs

6
src/ImageSharp/Image.FromBytes.cs

@ -91,9 +91,9 @@ namespace SixLabors.ImageSharp
/// <param name="data">The byte array containing image data.</param> /// <param name="data">The byte array containing image data.</param>
/// <exception cref="ArgumentNullException">The configuration is null.</exception> /// <exception cref="ArgumentNullException">The configuration is null.</exception>
/// <exception cref="ArgumentNullException">The data is null.</exception> /// <exception cref="ArgumentNullException">The data is null.</exception>
/// <returns>A new <see cref="Image{Rgba32}"/>.</returns> /// <returns>A new <see cref="Image"/>.</returns>
public static Image<Rgba32> Load(byte[] data) public static Image Load(byte[] data)
=> Load<Rgba32>(Configuration.Default, data); => Load(Configuration.Default, data);
/// <summary> /// <summary>
/// Load a new instance of <see cref="Image{TPixel}"/> from the given encoded byte array. /// Load a new instance of <see cref="Image{TPixel}"/> from the given encoded byte array.

4
tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs

@ -155,9 +155,9 @@ namespace SixLabors.ImageSharp.Tests.Formats.Gif
[Fact] [Fact]
public void CanDecodeIntermingledImages() public void CanDecodeIntermingledImages()
{ {
using (var kumin1 = Image.Load(TestFile.Create(TestImages.Gif.Kumin).Bytes)) using (var kumin1 = Image.Load<Rgba32>(TestFile.Create(TestImages.Gif.Kumin).Bytes))
using (Image.Load(TestFile.Create(TestImages.Png.Icon).Bytes)) using (Image.Load(TestFile.Create(TestImages.Png.Icon).Bytes))
using (var kumin2 = Image.Load(TestFile.Create(TestImages.Gif.Kumin).Bytes)) using (var kumin2 = Image.Load<Rgba32>(TestFile.Create(TestImages.Gif.Kumin).Bytes))
{ {
for (int i = 0; i < kumin1.Frames.Count; i++) for (int i = 0; i < kumin1.Frames.Count; i++)
{ {

Loading…
Cancel
Save