From 7b9fa020eb08f66defa90aedd60c184fad40d335 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sun, 17 Jul 2016 10:32:00 +1000 Subject: [PATCH] Ensure quality is carried across. Former-commit-id: 6069f3358b046e27a7aa3e56ac8a11cb6684b7e7 Former-commit-id: 34bf7b98f19e05db77daa5b7fc57020c3e563b08 Former-commit-id: 0b28b45eaa0450d775062c0be210856c57d96e7f --- src/ImageProcessorCore/Formats/Png/PngEncoderCore.cs | 12 +++++------- src/ImageProcessorCore/Image/Image.cs | 1 + src/ImageProcessorCore/Image/ImageExtensions.cs | 1 + 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ImageProcessorCore/Formats/Png/PngEncoderCore.cs b/src/ImageProcessorCore/Formats/Png/PngEncoderCore.cs index 15ed7793a..ab9057760 100644 --- a/src/ImageProcessorCore/Formats/Png/PngEncoderCore.cs +++ b/src/ImageProcessorCore/Formats/Png/PngEncoderCore.cs @@ -27,11 +27,6 @@ namespace ImageProcessorCore.Formats /// private byte bitDepth; - /// - /// The quantized image result. - /// - //private QuantizedImage quantized; - /// /// Gets or sets the quality of output for images. /// @@ -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); diff --git a/src/ImageProcessorCore/Image/Image.cs b/src/ImageProcessorCore/Image/Image.cs index 2c7ceeab1..f4c3ac6c6 100644 --- a/src/ImageProcessorCore/Image/Image.cs +++ b/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; diff --git a/src/ImageProcessorCore/Image/ImageExtensions.cs b/src/ImageProcessorCore/Image/ImageExtensions.cs index 67b126318..604908603 100644 --- a/src/ImageProcessorCore/Image/ImageExtensions.cs +++ b/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,