Image.Load on method below throws Method not found: '!0 System.ReadOnlySpan1.get_Item(Int32)'.` with the stack trace
at SixLabors.ImageSharp.Formats.Bmp.BmpImageFormatDetector.IsSupportedFileFormat(ReadOnlySpan`1 header)
at SixLabors.ImageSharp.Formats.Bmp.BmpImageFormatDetector.DetectFormat(ReadOnlySpan`1 header)
at SixLabors.ImageSharp.Image.<>c__DisplayClass0_0.<InternalDetectFormat>b__0(IImageFormatDetector x)
at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.TryGetLast[TSource](IEnumerable`1 source, Func`2 predicate, Boolean& found)
at SixLabors.ImageSharp.Image.InternalDetectFormat(Stream stream, Configuration config)
at SixLabors.ImageSharp.Image.Decode[TPixel](Stream stream, Configuration config)
at SixLabors.ImageSharp.Image.WithSeekableStream[T](Stream stream, Func`2 action)
at SixLabors.ImageSharp.Image.Load[TPixel](Configuration config, Stream stream, IImageFormat& format)
at SixLabors.ImageSharp.Image.Load[TPixel](Configuration config, Byte[] data)
at SourceProvider.Network.SrcLoader.<DownloadImageAsync>d__1.MoveNext() in D:\GitHub\ImageBlendingAlgorithms\ImageBlendingAlgorithms\SourceProvider\Network\SrcLoader.cs:line 26
--- End of stack trace from previous location where exception was thrown ---
at DesktopUI.MainWindow.<StartButtonHandle>d__11.MoveNext() in D:\GitHub\ImageBlendingAlgorithms\ImageBlendingAlgorithms\DesktopUI\MainWindow.xaml.cs:line 96
public static async Task<Image<Rgba32>> DownloadImageAsync(uint x, uint y)
{
var data = await DownloadSrcAsync(x, y);
return Image.Load(data);
}

Looks like this is related to this issue: https://github.com/dotnet/coreclr/pull/14727. Seeing that exception in one of the comments.
@dlemstra Yeah, that looks like the issue, good work.
@GeorgePlotnikov It looks like you are also using the preview of NETCore 2.1 Have you tried the 2.0 release? The library should be stable against that.
I'm not sure what (or even if) we will have to do when 2.1 reaches RTM but I'll ask around.
@dlemstra, @JimBobSquarePants thanks guys for the quick response, fixed via moving to netcore2.0
@JimBobSquarePants @dlemstra I have the same issue on .NET 4.6.2 do you have any advise in that case?
@molinch what version of System.Memory does does your project refer to? It's current (4.5) API is not backwards compatible with the previous 4.4 preview.
I assume your project is referencing the 4.5 preview, while ImageSharp beta has been compiled against 4.4. In that case the solution is easy however: just check out our latest nightlies, we moved to 4.5 with #482 .
In fact I was not using System.Memory before, it has been pulled when I got the latest prerelease for ImageSharp. So now I have System.Memory 4.5.0-preview1-26216-02
My assembly bindings got updated for some assemblies: System.Runtime, System.Runtime.Extensions, System.Reflection and some got added: System.Numerics.Vectors, System.Runtime.CompilerServices.Unsafe, System.Memory, System.Diagnostics.Tracing
Sorry I understand what you meant now :+1:
I will try to downgrade System.Memory then, I'd rather not use a nightly in production
NuGet is pulling the newest version by default as far as I understand.
@JimBobSquarePants this is a very serious issue. All new users + all users doing a NuGet update will encounter it. Fortunately beta-3 is coming very soon.
I agree for new users it's really a pain, even though it's Microsoft's fault since they unlisted their package...
For reference I ended up doing in my projects:
Update-Package -ProjectName MyProjectName -Id System.Memory -Pre -Version 4.4.0-preview2-25405-01
And I needed to change assembly bindings
I will try to downgrade System.Memory then, I'd rather not use a nightly in production
Tut tut... You shouldn't be using a beta in production! 馃槈
Progress is moving swiftly with beta3 and we should have it out in the next few days - a week max.
We will be moving your cheese around though with lots of namespace changes (sensible ones). We should have API docs though to help you migrate.
Yes you are right, I meant "future release" which will eventually go to production.
The thing is there are not so many alternatives when you need to process images on ASP.NET: System.Drawing shouldn't be used, WPF libs should of course not be used, ... What's left?
I think that I will anyway revert back to System.Drawing temporarily, even though that's a bad idea, since I added ImageSharp I have issues related to .NETStandard/MSBuild: https://github.com/dotnet/corefx/issues/25773#issuecomment-350000563
Once again it's nothing from you, ImageSharp is really great and the API is a breaze, but it's just too many issues just to make a simple thumbnail
We'll get there soon. It's difficult to build something like this when the goalposts are moved so often upstream.
but it's just too many issues just to make a simple thumbnail
Nothing simple about a thumbnail Have you seen the code in that class. Resizing it hard! 馃槃
I'm attempting to use this library on Xamarin Android and I am seeing the exception happening as well. I have a NetStandard library targeting 2.0 and the issue still persists. Is there something wrong that I'm doing?
using (Image<Rgba32> image = SixLabors.ImageSharp.Image.Load(path))
using the beta0002 version of SixLabors.ImageSharp
What version of System.Memory are you using? Have you tried the steps above?
https://github.com/SixLabors/ImageSharp/issues/447#issuecomment-370795694
The System.Memory package version was already at 4.4.0-preview2-25405-01. I'm using visual studio for mac if that makes any difference?
So your local Nuget is 4.4.0-preview2-25405-01 ?
If so try also changing your assembly bindings
I don't know what it means to change assembly bindings.
In your app.config or web.config, if you have an entry for System.Memory under
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
The my netstandard project doesn't have an app.config just a single class with the SixLabors.ImageSharp library installed. This project is then referenced by a Xamarin.Android project.

Do you have an app.config in your Xamarin.Android project?
If yes then add the binding redirect there.
That didn't seem to help. I've attached a sample solution for a xamarin android project the demonstrates the error. Created with visual studio 2017 on a pc. Perhaps you could take a look and tell me where I went wrong.
I would grab the nightlies from our MyGet feed. That should work fine.
@JimBobSquarePants Is there any plan/release date when using ImageSharp with .NET Core 2.1 will be supported? At least basic scenarios like LoadingImage from FileName.
@JimBobSquarePants Is there any plan/release date when using ImageSharp with .NET Core 2.1 will be supported? At least basic scenarios like LoadingImage from FileName
Don't be that guy. .NET Core 2.1 isn't even released yet.
Updating to beta04 solved this problem :) Thank you !
Any plan/release for supporting .Net Core2.1?
We already support the release candidate with beta 4. I鈥檝e tested the final release against it and it works
Ah okay, Thanks
I am using version: 1.0.0-alpha9-00194. May be that's why.
Does beta 4 supports all of the feature that 1.0.0-alpha9 supports, because I can't see Resize() method on Image
your help would be greatly appreciated !!
Yes of course. You should probably read the api documentation linked from our readme.
@boradakash:
That's a super-old buggy version, we had many fixes/changes since that. Please read this article for the major API change introducing Mutate/Clone:
https://sixlabors.com/blog/announcing-imagesharp-beta-1/
@antonfirsov
Cool thanks.
Most helpful comment
Updating to beta04 solved this problem :) Thank you !