diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs index 655665e29..2bd4b95fd 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs @@ -144,8 +144,6 @@ internal class SpectralConverter : SpectralConverter, IDisposable JpegColorConverterBase.ComponentValues values = new(this.componentProcessors, y); - values = values.Slice(0, width); // slice away Jpeg padding - if (iccProfile != null) { this.colorConverter.ConvertToRgbInPlaceWithIcc(this.Configuration, in values, iccProfile); @@ -155,6 +153,8 @@ internal class SpectralConverter : SpectralConverter, IDisposable this.colorConverter.ConvertToRgbInPlace(in values); } + values = values.Slice(0, width); // slice away Jpeg padding + Span r = this.rgbBuffer.Slice(0, width); Span g = this.rgbBuffer.Slice(width, width); Span b = this.rgbBuffer.Slice(width * 2, width);