Skip to content

Commit

Permalink
Merge pull request #1573 from SixLabors/af/fix-overload
Browse files Browse the repository at this point in the history
Image.Load(byte[]) should return non-generic Image
  • Loading branch information
JimBobSquarePants authored Mar 9, 2021
2 parents 36018bd + 583bb6b commit ae8e5e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/ImageSharp/Image.FromBytes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public static IImageInfo Identify(Configuration configuration, byte[] data, out
/// <param name="data">The byte array containing image data.</param>
/// <exception cref="ArgumentNullException">The configuration is null.</exception>
/// <exception cref="ArgumentNullException">The data is null.</exception>
/// <returns>A new <see cref="Image{Rgba32}"/>.</returns>
public static Image<Rgba32> Load(byte[] data)
=> Load<Rgba32>(Configuration.Default, data);
/// <returns>A new <see cref="Image"/>.</returns>
public static Image Load(byte[] data)
=> Load(Configuration.Default, data);

/// <summary>
/// Load a new instance of <see cref="Image{TPixel}"/> from the given encoded byte array.
Expand Down
4 changes: 2 additions & 2 deletions tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ public void Decode_WithMaxDimensions_Works<TPixel>(TestImageProvider<TPixel> pro
[Fact]
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 (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++)
{
Expand Down

0 comments on commit ae8e5e4

Please sign in to comment.