-
-
Notifications
You must be signed in to change notification settings - Fork 893
Converting Png to Jpg give a color background and not white (Asp.Net Core) #355
Copy link
Copy link
Closed
Description
Description
My goal is to generate renditions (thumbnail, and other size of the image) from an uploaded image (IFormFile, png or jpg).
When uploading a .png with transparency, the resulting image has a background of a color in the image and not a default white one.
Steps to Reproduce
public static Stream GenerateCompressedOriginal(IFormFile file)
{
Stream outputStream = new MemoryStream();
using (Image<Rgba32> image = Image.Load(file.OpenReadStream()))
{
image.SaveAsJpeg(outputStream, new JpegEncoder() { Quality = 80 });
}
return outputStream;
}
if i save the outputstream as a jpg. the error occur. The image variable has also this background in color and not white.
System Configuration
- ImageSharp version: 1.0.0-alpha9-00194
- Environment (Operating system, version and so on): windows 10
- .NET Framework version: .Net Standard 1.6
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

