Browse Source

Removed first component dependency in compoentn initialization code

pull/1702/head
Dmitry Pentin 5 years ago
parent
commit
c751b27334
  1. 3
      src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegComponent.cs

3
src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegComponent.cs

@ -123,8 +123,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
int blocksPerColumnForMcu = this.Frame.McusPerColumn * this.VerticalSamplingFactor;
this.SizeInBlocks = new Size(blocksPerLineForMcu, blocksPerColumnForMcu);
JpegComponent c0 = this.Frame.Components[0];
this.SubSamplingDivisors = c0.SamplingFactors.DivideBy(this.SamplingFactors);
this.SubSamplingDivisors = new Size(maxSubFactorH, maxSubFactorV).DivideBy(this.SamplingFactors);
if (this.SubSamplingDivisors.Width == 0 || this.SubSamplingDivisors.Height == 0)
{

Loading…
Cancel
Save