Skip to content

Commit 33aa644

Browse files
Don't use RGB. Fixes #1275
1 parent fd85f10 commit 33aa644

File tree

1 file changed

+12
-1
lines changed
  • src/ImageSharp/PixelFormats/PixelImplementations

1 file changed

+12
-1
lines changed

src/ImageSharp/PixelFormats/PixelImplementations/Rgb24.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,18 @@ public void FromLa32(La32 source)
201201

202202
/// <inheritdoc/>
203203
[MethodImpl(InliningOptions.ShortMethod)]
204-
public void FromRgba32(Rgba32 source) => this = source.Rgb;
204+
public void FromRgba32(Rgba32 source)
205+
{
206+
#if NETSTANDARD2_0
207+
208+
// See https://github.com/SixLabors/ImageSharp/issues/1275
209+
this.R = source.R;
210+
this.G = source.G;
211+
this.B = source.B;
212+
#else
213+
this = source.Rgb;
214+
#endif
215+
}
205216

206217
/// <inheritdoc />
207218
[MethodImpl(InliningOptions.ShortMethod)]

0 commit comments

Comments
 (0)