From 1ac38e3fcffbcbcb9f73c906ff91c873fd5cc30a Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 6 Aug 2020 21:39:00 +0100 Subject: [PATCH] Don't use RGB. Fixes #1275 --- .../PixelFormats/PixelImplementations/Rgb24.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Rgb24.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Rgb24.cs index 60cbccded..a3924b97d 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Rgb24.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Rgb24.cs @@ -201,7 +201,18 @@ namespace SixLabors.ImageSharp.PixelFormats /// [MethodImpl(InliningOptions.ShortMethod)] - public void FromRgba32(Rgba32 source) => this = source.Rgb; + public void FromRgba32(Rgba32 source) + { +#if NETSTANDARD2_0 + + // See https://github.com/SixLabors/ImageSharp/issues/1275 + this.R = source.R; + this.G = source.G; + this.B = source.B; +#else + this = source.Rgb; +#endif + } /// [MethodImpl(InliningOptions.ShortMethod)]