Browse Source

Ensure all properties are copied over

Former-commit-id: d7d79e398f6205617b7dd6bb07ea4a83aee8e1c2
Former-commit-id: 113f96c2b7334a6027e4ddd48c3aebe5126eabfc
Former-commit-id: 69a7b14f2d59f00fed2ea3f53111cf34ad818173
pull/1/head
James Jackson-South 10 years ago
parent
commit
d27f0facfa
  1. 15
      src/ImageProcessorCore/ImageExtensions.cs

15
src/ImageProcessorCore/ImageExtensions.cs

@ -133,11 +133,16 @@ namespace ImageProcessorCore
/// <returns>The <see cref="Image"/>.</returns>
private static Image PerformAction(Image source, bool clone, Action<ImageBase, ImageBase> 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);

Loading…
Cancel
Save