Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegFrame.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors.
// Copyright (c) Six Labors and contributors.
// Licensed under the GNU Affero General Public License, Version 3.

using System;
Expand Down Expand Up @@ -28,12 +28,12 @@ internal sealed class JpegFrame : IDisposable
/// <summary>
/// Gets or sets the number of scanlines within the frame.
/// </summary>
public short Scanlines { get; set; }
public int Scanlines { get; set; }

/// <summary>
/// Gets or sets the number of samples per scanline.
/// </summary>
public short SamplesPerLine { get; set; }
public int SamplesPerLine { get; set; }

/// <summary>
/// Gets or sets the number of components within a frame. In progressive frames this value can range from only 1 to 4.
Expand Down Expand Up @@ -105,4 +105,4 @@ public void InitComponents()
}
}
}
}
}
4 changes: 2 additions & 2 deletions src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,8 @@ private void ProcessStartOfFrameMarker(int remaining, in JpegFileMarker frameMar
Extended = frameMarker.Marker == JpegConstants.Markers.SOF1,
Progressive = frameMarker.Marker == JpegConstants.Markers.SOF2,
Precision = this.temp[0],
Scanlines = (short)((this.temp[1] << 8) | this.temp[2]),
SamplesPerLine = (short)((this.temp[3] << 8) | this.temp[4]),
Scanlines = (this.temp[1] << 8) | this.temp[2],
SamplesPerLine = (this.temp[3] << 8) | this.temp[4],
ComponentCount = this.temp[5]
};

Expand Down