-
-
Notifications
You must be signed in to change notification settings - Fork 888
Closed
Labels
Description
Prerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of ImageSharp
- I have verified if the problem exist in both
DEBUGandRELEASEmode - I have searched open and closed issues to ensure it has not already been reported
Description
Setting ColorType property on PngEncoder settings causes NotSupportedException.
Here's the stacktrace:
at SixLabors.ImageSharp.Formats.Png.PngEncoderCore.Encode[TPixel](Image`1 image, Stream stream)
at SixLabors.ImageSharp.Formats.Png.PngEncoder.Encode[TPixel](Image`1 image, Stream stream)
at SixLabors.ImageSharp.ImageExtensions.Save(Image source, String filePath, IImageEncoder encoder)
at ImageSharpTest.Program.Main(String[] args) in C:\Users\User\Documents\Visual Studio 2019\Projects\ImageSharpTest\Program.cs:line 16
Steps to Reproduce
using (var image = Image.Load("image.png"))
{
image.Save("output.png", new PngEncoder { ColorType = PngColorType.RgbWithAlpha });
}
with image image.zip
Just adding BitDepth = PngBitDepth.Bit8 to PngEncoder settings solves this problem.
System Configuration
- ImageSharp version: 1.0.0-dev002749
- Other ImageSharp packages and versions:
- Environment (Operating system, version and so on):
- .NET Framework version:
- Additional information: