Open 3400442579 opened 8 months ago
I also had this issue, you can fix it by downgrading your SixLabors.ImageSharp version to 2. in you csproj like so: `<PackageReference Include="SixLabors.ImageSharp" Version="2." />` or I guess the following merge request could fix it, if someone would accept it: #400
still not fixed this, I had to patch it myself so I could use the last version of the library. You just need to extend the class ImageSource as he did with ImageSharpImageSource. The bug is in this method that changed in the lasts upgrades of the library: SixLabors.ImageSharp.Image.Load now only accepts ONE parameter instead of two.
` protected override IImageSource FromBinaryImpl(string name, Func<byte[]> imageSource, int? quality = 75) { ArgumentNullException.ThrowIfNull(imageSource);
var source = imageSource();
Image image = Image.Load(source);
return new ImageSharpImageSourceImplementation(name, image, quality.Value, image.Metadata.DecodedImageFormat is
PngFormat);
}
`
Here´s an example of an override method I extended in my new class.
System.MissingMethodException: Method not found: 'SixLabors.ImageSharp.Image
1<!!0> SixLabors.ImageSharp.Image.Load(System.String, SixLabors.ImageSharp.Formats.IImageFormat ByRef)'. at PdfSharpCore.Utils.ImageSharpImageSource
1.FromFileImpl(String path, Nullable1 quality) at MigraDocCore.DocumentObjectModel.MigraDoc.DocumentObjectModel.Shapes.ImageSource.FromFile(String path, Nullable
1 quality) at PdfSharpCore.Drawing.XImage..ctor(String path) at PdfSharpCore.Drawing.XImage.FromFile(String path, PdfReadAccuracy accuracy) at PdfSharpCore.Drawing.XImage.FromFile(String path)