From d27f0facfa606ba1d65247fb33b86593cc0bf570 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 25 Feb 2016 17:57:58 +1100 Subject: [PATCH] Ensure all properties are copied over Former-commit-id: d7d79e398f6205617b7dd6bb07ea4a83aee8e1c2 Former-commit-id: 113f96c2b7334a6027e4ddd48c3aebe5126eabfc Former-commit-id: 69a7b14f2d59f00fed2ea3f53111cf34ad818173 --- src/ImageProcessorCore/ImageExtensions.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ImageProcessorCore/ImageExtensions.cs b/src/ImageProcessorCore/ImageExtensions.cs index cf36f8030..09cd06f63 100644 --- a/src/ImageProcessorCore/ImageExtensions.cs +++ b/src/ImageProcessorCore/ImageExtensions.cs @@ -133,11 +133,16 @@ namespace ImageProcessorCore /// The . private static Image PerformAction(Image source, bool clone, Action action) { - Image transformedImage = clone ? new Image(source) : new Image(); - - // Only on clone? - transformedImage.CurrentImageFormat = source.CurrentImageFormat; - transformedImage.RepeatCount = source.RepeatCount; + Image transformedImage = clone + ? new Image(source) + : new Image + { + // Several properties require copying + HorizontalResolution = source.HorizontalResolution, + VerticalResolution = source.VerticalResolution, + CurrentImageFormat = source.CurrentImageFormat, + RepeatCount = source.RepeatCount + }; action(source, transformedImage);