Skip to content

Add support for .NET Core 2.1 #459

@msmolka

Description

@msmolka

Description

I've recently upgrade my system to ASP.NET Core 2.1.0-preview2-30045
This libraries are using System.Memory 4.5.0-preview2-26202-05

After update I'm not able to load image any more:
using (var image = Image.Load<Rgba32>(pictureDataBytes, new PngDecoder()))

this is throwing exception:

System.MethodAccessException: Attempt by method 'SixLabors.ImageSharp.Formats.Png.Filters.SubFilter.Decode(System.Span`1<Byte>, Int32)' to access method 'System.Span`1<System.Byte>.DangerousGetPinnableReference()' failed.
   at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.DecodePixelData[TPixel](Stream compressedStream, ImageFrame`1 image)
   at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.Decode[TPixel](Stream stream)
   at SixLabors.ImageSharp.Formats.Png.PngDecoder.Decode[TPixel](Configuration configuration, Stream stream)
   at SixLabors.ImageSharp.Image.<>c__DisplayClass43_0`1.<Load>b__0(Stream s)
   at SixLabors.ImageSharp.Image.WithSeekableStream[T](Stream stream, Func`2 action)
   at SixLabors.ImageSharp.Image.Load[TPixel](Stream stream, IImageDecoder decoder)
   at SixLabors.ImageSharp.Image.Load[TPixel](Byte[] data, IImageDecoder decoder)

Steps to Reproduce

use System.Memory 4.5.0-preview2-26202-05 and try to load PNG image.

System Configuration

  • ImageSharp version: 1.0.0-beta0002
  • Other ImageSharp packages and versions: 1.0.0-beta0002
  • Environment (Operating system, version and so on): Windows 10
  • .NET Framework version: 4.6.2
  • Additional information:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions