Browse Source

Ensure quality is carried across.

Former-commit-id: 6069f3358b046e27a7aa3e56ac8a11cb6684b7e7
Former-commit-id: 34bf7b98f19e05db77daa5b7fc57020c3e563b08
Former-commit-id: 0b28b45eaa0450d775062c0be210856c57d96e7f
pull/1/head
James Jackson-South 10 years ago
parent
commit
7b9fa020eb
  1. 12
      src/ImageProcessorCore/Formats/Png/PngEncoderCore.cs
  2. 1
      src/ImageProcessorCore/Image/Image.cs
  3. 1
      src/ImageProcessorCore/Image/ImageExtensions.cs

12
src/ImageProcessorCore/Formats/Png/PngEncoderCore.cs

@ -27,11 +27,6 @@ namespace ImageProcessorCore.Formats
/// </summary>
private byte bitDepth;
/// <summary>
/// The quantized image result.
/// </summary>
//private QuantizedImage<T,P> quantized;
/// <summary>
/// Gets or sets the quality of output for images.
/// </summary>
@ -237,7 +232,10 @@ namespace ImageProcessorCore.Formats
int colorTableLength = (int)Math.Pow(2, header.BitDepth) * 3;
byte[] colorTable = new byte[colorTableLength];
Parallel.For(0, pixelCount,
Parallel.For(
0,
pixelCount,
Bootstrapper.Instance.ParallelOptions,
i =>
{
int offset = i * 3;
@ -337,7 +335,7 @@ namespace ImageProcessorCore.Formats
Parallel.For(
0,
imageHeight,
//Bootstrapper.Instance.ParallelOptions,
Bootstrapper.Instance.ParallelOptions,
y =>
{
int dataOffset = (y * rowLength);

1
src/ImageProcessorCore/Image/Image.cs

@ -85,6 +85,7 @@ namespace ImageProcessorCore
}
}
this.Quality = other.Quality;
this.RepeatCount = other.RepeatCount;
this.HorizontalResolution = other.HorizontalResolution;
this.VerticalResolution = other.VerticalResolution;

1
src/ImageProcessorCore/Image/ImageExtensions.cs

@ -154,6 +154,7 @@ namespace ImageProcessorCore
{
// Several properties require copying
// TODO: Check why we need to set these?
Quality = source.Quality,
HorizontalResolution = source.HorizontalResolution,
VerticalResolution = source.VerticalResolution,
CurrentImageFormat = source.CurrentImageFormat,

Loading…
Cancel
Save