Browse Source

Rename to hasFrames

pull/205/head
James Jackson-South 9 years ago
parent
commit
0f2a6242c8
  1. 8
      src/ImageSharp/Formats/Gif/GifEncoderCore.cs

8
src/ImageSharp/Formats/Gif/GifEncoderCore.cs

@ -38,7 +38,7 @@ namespace ImageSharp.Formats
/// <summary> /// <summary>
/// Whether the current image has multiple frames. /// Whether the current image has multiple frames.
/// </summary> /// </summary>
private bool hasMultipleFrames; private bool hasFrames;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="GifEncoderCore"/> class. /// Initializes a new instance of the <see cref="GifEncoderCore"/> class.
@ -79,11 +79,11 @@ namespace ImageSharp.Formats
this.bitDepth = ImageMaths.GetBitsNeededForColorDepth(quality); this.bitDepth = ImageMaths.GetBitsNeededForColorDepth(quality);
// Quantize the image returning a palette. // Quantize the image returning a palette.
this.hasMultipleFrames = image.Frames.Any(); this.hasFrames = image.Frames.Any();
// Dithering when animating gifs is a bad idea as we introduce pixel tearing across frames. // Dithering when animating gifs is a bad idea as we introduce pixel tearing across frames.
IQuantizer<TPixel> ditheredQuantizer = (IQuantizer<TPixel>)this.Quantizer; IQuantizer<TPixel> ditheredQuantizer = (IQuantizer<TPixel>)this.Quantizer;
ditheredQuantizer.Dither = !this.hasMultipleFrames; ditheredQuantizer.Dither = !this.hasFrames;
QuantizedImage<TPixel> quantized = ditheredQuantizer.Quantize(image, quality); QuantizedImage<TPixel> quantized = ditheredQuantizer.Quantize(image, quality);
@ -103,7 +103,7 @@ namespace ImageSharp.Formats
this.WriteImageData(quantized, writer); this.WriteImageData(quantized, writer);
// Write additional frames. // Write additional frames.
if (this.hasMultipleFrames) if (this.hasFrames)
{ {
this.WriteApplicationExtension(writer, image.MetaData.RepeatCount, image.Frames.Count); this.WriteApplicationExtension(writer, image.MetaData.RepeatCount, image.Frames.Count);

Loading…
Cancel
Save