Browse Source

Add SOF5 and SOF6 to the unsupported jpeg markers

pull/1742/head
Brian Popow 5 years ago
parent
commit
27cbafecd6
  1. 10
      src/ImageSharp/Formats/Jpeg/JpegConstants.cs
  2. 8
      src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

10
src/ImageSharp/Formats/Jpeg/JpegConstants.cs

@ -183,6 +183,16 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// </summary>
public const byte SOF3 = 0xC3;
/// <summary>
/// Start of Frame marker, differential, Huffman coding, Differential sequential DCT.
/// </summary>
public const byte SOF5 = 0xC5;
/// <summary>
/// Start of Frame marker, differential, Huffman coding, Differential progressive DCT.
/// </summary>
public const byte SOF6 = 0xC6;
/// <summary>
/// Start of Frame marker, differential lossless, Huffman coding.
/// </summary>

8
src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

@ -247,6 +247,14 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
this.ProcessStartOfFrameMarker(stream, remaining, fileMarker, metadataOnly);
break;
case JpegConstants.Markers.SOF5:
JpegThrowHelper.ThrowNotSupportedException("Decoding jpeg files with differential sequential DCT is not supported.");
break;
case JpegConstants.Markers.SOF6:
JpegThrowHelper.ThrowNotSupportedException("Decoding jpeg files with differential progressive DCT is not supported.");
break;
case JpegConstants.Markers.SOF3:
case JpegConstants.Markers.SOF7:
JpegThrowHelper.ThrowNotSupportedException("Decoding lossless jpeg files is not supported.");

Loading…
Cancel
Save