Browse Source

Fixed compilation errors

pull/1706/head
Dmitry Pentin 5 years ago
parent
commit
d50f4b51ca
  1. 4
      src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs
  2. 46
      src/ImageSharp/Formats/Jpeg/JpegMetadata.cs

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

@ -834,7 +834,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
jpegMetadata.LumaQuality = quality; jpegMetadata.LumaQuality = quality;
if (variance <= Quantization.StandardLuminanceTableVarianceThreshold) if (variance <= Quantization.StandardLuminanceTableVarianceThreshold)
{ {
jpegMetadata.lumaQuantizationTable = table.RoundAsInt16Block(); jpegMetadata.LumaQuantizationTable = table.RoundAsInt16Block();
} }
break; break;
@ -847,7 +847,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
jpegMetadata.ChromaQuality = quality; jpegMetadata.ChromaQuality = quality;
if (variance <= Quantization.StandardChrominanceTableVarianceThreshold) if (variance <= Quantization.StandardChrominanceTableVarianceThreshold)
{ {
jpegMetadata.chromaQuantizationTable = table.RoundAsInt16Block(); jpegMetadata.ChromaQuantizationTable = table.RoundAsInt16Block();
} }
break; break;

46
src/ImageSharp/Formats/Jpeg/JpegMetadata.cs

@ -11,26 +11,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// </summary> /// </summary>
public class JpegMetadata : IDeepCloneable public class JpegMetadata : IDeepCloneable
{ {
/// <summary>
/// Luminance qunatization table derived from jpeg image.
/// </summary>
/// <remarks>
/// Would be null if jpeg was encoded using table from ITU spec
/// </remarks>
internal Block8x8? lumaQuantizationTable;
/// <summary>
/// Luminance qunatization table derived from jpeg image.
/// </summary>
/// <remarks>
/// Would be null if jpeg was encoded using table from ITU spec
/// </remarks>
internal Block8x8? chromaQuantizationTable;
internal double LumaQuality;
internal double ChromaQuality;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="JpegMetadata"/> class. /// Initializes a new instance of the <see cref="JpegMetadata"/> class.
/// </summary> /// </summary>
@ -47,12 +27,32 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
this.Quality = other.Quality; this.Quality = other.Quality;
this.ColorType = other.ColorType; this.ColorType = other.ColorType;
this.lumaQuantizationTable = other.lumaQuantizationTable; this.LumaQuantizationTable = other.LumaQuantizationTable;
this.chromaQuantizationTable = other.chromaQuantizationTable; this.ChromaQuantizationTable = other.ChromaQuantizationTable;
this.LumaQuality = other.LumaQuality; this.LumaQuality = other.LumaQuality;
this.ChromaQuality = other.ChromaQuality; this.ChromaQuality = other.ChromaQuality;
} }
/// <summary>
/// Gets or sets luminance qunatization table derived from jpeg image.
/// </summary>
/// <remarks>
/// Would be null if jpeg was encoded using table from ITU spec
/// </remarks>
internal Block8x8? LumaQuantizationTable { get; set; }
/// <summary>
/// Gets or sets chrominance qunatization table derived from jpeg image.
/// </summary>
/// <remarks>
/// Would be null if jpeg was encoded using table from ITU spec
/// </remarks>
internal Block8x8? ChromaQuantizationTable { get; set; }
internal double LumaQuality { get; set; }
internal double ChromaQuality { get; set; }
/// <summary> /// <summary>
/// Gets or sets the encoded quality. /// Gets or sets the encoded quality.
/// </summary> /// </summary>
@ -65,7 +65,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <summary> /// <summary>
/// Gets a value indicating whether jpeg was encoded using ITU section spec K.1 quantization tables /// Gets a value indicating whether jpeg was encoded using ITU section spec K.1 quantization tables
/// </summary> /// </summary>
public bool ItuSpecQuantization => !this.lumaQuantizationTable.HasValue && !this.chromaQuantizationTable.HasValue; public bool ItuSpecQuantization => !this.LumaQuantizationTable.HasValue && !this.ChromaQuantizationTable.HasValue;
/// <summary> /// <summary>
/// Gets or sets the encoded quality. /// Gets or sets the encoded quality.

Loading…
Cancel
Save