-
-
Notifications
You must be signed in to change notification settings - Fork 888
Closed
Description
Description
I am getting the above error on using (var image = Image.Load(inStream))
Steps to Reproduce
async Task Upload(IMatFileUploadEntry file)
{
if (file != null)
{
byte[] bytes;
using (var inStream = new MemoryStream())
{
await file.WriteToStreamAsync(inStream);
using (var outStream = new MemoryStream())
using (var image = Image.Load(inStream))
{
image.Mutate(x => x.Resize(new ResizeOptions
{
Size = new SixLabors.ImageSharp.Size(Settings.LOGO_LENGTH, Settings.LOGO_HEIGHT),
Mode = ResizeMode.Pad
}).BackgroundColor(new Color(new Rgba32(255, 255, 255, 1))));
image.SaveAsPng(outStream);
bytes = outStream.ToArray();
Item.Icon = Convert.ToBase64String(bytes);
Console.WriteLine(Item.Icon);
}
}
}
System Configuration
Blazor WASM.
The image is coming from https://www.matblazor.com/FileUpload.
- ImageSharp version: 1.0.0-beta0008
- Environment (Operating system, version and so on): Win 10
- .NET Framework version: netstandard 2.1
Metadata
Metadata
Assignees
Labels
No labels