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

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

@ -11,26 +11,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// </summary>
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>
/// Initializes a new instance of the <see cref="JpegMetadata"/> class.
/// </summary>
@ -47,12 +27,32 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
this.Quality = other.Quality;
this.ColorType = other.ColorType;
this.lumaQuantizationTable = other.lumaQuantizationTable;
this.chromaQuantizationTable = other.chromaQuantizationTable;
this.LumaQuantizationTable = other.LumaQuantizationTable;
this.ChromaQuantizationTable = other.ChromaQuantizationTable;
this.LumaQuality = other.LumaQuality;
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>
/// Gets or sets the encoded quality.
/// </summary>
@ -65,7 +65,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <summary>
/// Gets a value indicating whether jpeg was encoded using ITU section spec K.1 quantization tables
/// </summary>
public bool ItuSpecQuantization => !this.lumaQuantizationTable.HasValue && !this.chromaQuantizationTable.HasValue;
public bool ItuSpecQuantization => !this.LumaQuantizationTable.HasValue && !this.ChromaQuantizationTable.HasValue;
/// <summary>
/// Gets or sets the encoded quality.

Loading…
Cancel
Save