Browse Source

Update src/ImageSharp/Formats/Png/PngMetadata.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pull/2975/head
James Jackson-South 6 months ago
committed by GitHub
parent
commit
20975bcd8b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      src/ImageSharp/Formats/Png/PngMetadata.cs

2
src/ImageSharp/Formats/Png/PngMetadata.cs

@ -234,7 +234,7 @@ public class PngMetadata : IFormatMetadata<PngMetadata>
this.ColorTable = null;
// If the color type is RGB and we have a transparent color, we need to switch to RGBA
// so that we do not incorrectly preserve the obsolete tRNS chunk.
// so that we do not incorrectly preserve the obsolete tRNS chunk.
if (this.ColorType == PngColorType.Rgb && this.TransparentColor.HasValue)
{
this.ColorType = PngColorType.RgbWithAlpha;

Loading…
Cancel
Save