You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Image.Load throws an ArgumentException when loading PNG #937
I have verified that I am running the latest version of ImageSharp
I have verified if the problem exist in both DEBUG and RELEASE mode
I have searched open and closed issues to ensure it has not already been reported
Description
***Possibly related to 849 but separate issue ***
Loading the following PNG (from a Stream or ReadOnlyMemory instance) throws an ArgumentException.
Which has the following message:
Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
Notes:
The issue occurs in beta6 AND the latest dev build dev002749. The issue appears to be closely related to 849, but while that particular case is fixed in the latest dev build, I still get this error for the image linked in this issue.
The image renders in Chrome correctly
The images are video thumbnails produced by Amazon's Elastic Transcoder service. I have tested multiple thumbnails from various videos with the same result, so it doesn't seem to be a one-off problem with this particular image.
Steps to Reproduce
Use the above image in a FileStream (or any Stream representation).
Load the image (this can be copied/pasted into a .NET Core 2.2 console app and the ImageSharp libraries referenced):
static async Task Main()
{
try
{
// Use http client.
var client = new HttpClient();
// Make the request.
using (Stream stream = await client.GetStreamAsync(
"https://user-images.githubusercontent.com/561862/54476020-e3ab4c00-47ce-11e9-9cb1-2542507bf23c.png")
.ConfigureAwait(false))
{
Image<Rgba32> image = Image.Load<Rgba32>(stream, new PngDecoder());
}
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
}
Activity
JimBobSquarePants commentedon Jun 18, 2019
Thanks for the reproducible code sample! That will really help with debugging:+1:
Fix #937
WIP: #12 Synch with master and improve performance of decoders (#986)
Fix SixLabors#937 (SixLabors#938)