SixLabors.ImageSharp update from 1.0.0-beta0009 to 2.0.0

32 Views Asked by At

I am currently using SixLabors.ImageSharp 1.0.0-beta0009 in my .NET Core app. The startup.cs has the following:

        services.AddImageSharp()
            .SetMemoryAllocator(provider => ArrayPoolMemoryAllocator.CreateWithMinimalPooling());

I updated is to 2.0.0 and now I get an error saying "SetMemoryAllocator" is not available.

Is it alright to just get rid of SetMemoryAllocator? and just do services.AddImageSharp()

From SixLabors website and I found the folling:

Starting with ImageSharp 2.0, the library uses large (~4MB) discontiguous chunks of unmanaged memory to represent multi-megapixel images. Internally, these buffers are heavily pooled to reduce OS allocation overhead.

Which makes me think that's why they do not have SetMemoryAllocator anymore. Am I right?

0

There are 0 best solutions below