Skip to content

Commit

Permalink
Fix for Issue SixLabors#871 and SixLabors#914
Browse files Browse the repository at this point in the history
  • Loading branch information
brianpopow committed May 24, 2019
1 parent 2b5a575 commit 6f3b0c5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/ImageSharp/PixelFormats/PixelImplementations/Rgba32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,16 @@ public uint Rgba
/// </summary>
public Rgb24 Rgb
{
// If this is changed to ShortMethod then several jpeg encoding tests fail
// on 32 bit Net 4.6.2 and NET 4.7.1
[MethodImpl(InliningOptions.ColdPath)]
get => Unsafe.As<Rgba32, Rgb24>(ref this);
[MethodImpl(InliningOptions.ShortMethod)]
get => new Rgb24(this.R, this.G, this.B);

[MethodImpl(InliningOptions.ShortMethod)]
set => Unsafe.As<Rgba32, Rgb24>(ref this) = value;
set
{
this.R = value.R;
this.G = value.G;
this.B = value.B;
}
}

/// <summary>
Expand Down

0 comments on commit 6f3b0c5

Please sign in to comment.