Browse Source

Ensure properties are copied across.

Former-commit-id: ebf56f15f37cd5ae647107a59a3f733fe10d58e3
Former-commit-id: f01ade25fd315b240d1e9c606f5e252b55efef83
Former-commit-id: 77f3a78dd2e7a2ad351500620994e6b8858d8467
pull/17/head
James Jackson-South 10 years ago
parent
commit
ae7b24058c
  1. 2
      src/ImageProcessor/ImageBase.cs
  2. 4
      src/ImageProcessor/ImageExtensions.cs
  3. 1
      src/ImageProcessor/ImageProcessor.csproj
  4. 8
      tests/ImageProcessor.Tests/Filters/FilterTests.cs

2
src/ImageProcessor/ImageBase.cs

@ -60,6 +60,8 @@ namespace ImageProcessor
this.Width = other.Width;
this.Height = other.Height;
this.Quality = other.Quality;
this.FrameDelay = other.FrameDelay;
this.Pixels = new byte[pixels.Length];
Array.Copy(pixels, this.Pixels, pixels.Length);
}

4
src/ImageProcessor/ImageExtensions.cs

@ -86,7 +86,11 @@ namespace ImageProcessor
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;
action(source, transformedImage);
for (int i = 0; i < source.Frames.Count; i++)

1
src/ImageProcessor/ImageProcessor.csproj

@ -190,7 +190,6 @@
<None Include="Formats\Gif\README.md" />
<None Include="Formats\Jpg\README.md" />
<None Include="packages.config" />
<AdditionalFiles Include="stylecop.json" />
</ItemGroup>
<ItemGroup>
<None Include="Formats\Bmp\README.md" />

8
tests/ImageProcessor.Tests/Filters/FilterTests.cs

@ -13,12 +13,12 @@ namespace ImageProcessor.Tests.Filters
{
public static readonly List<string> Files = new List<string>
{
{ "../../TestImages/Formats/Jpg/Backdrop.jpg"},
{ "../../TestImages/Formats/Bmp/Car.bmp" },
{ "../../TestImages/Formats/Png/cmyk.png" },
//{ "../../TestImages/Formats/Jpg/Backdrop.jpg"},
//{ "../../TestImages/Formats/Bmp/Car.bmp" },
//{ "../../TestImages/Formats/Png/cmyk.png" },
//{ "../../TestImages/Formats/Gif/a.gif" },
//{ "../../TestImages/Formats/Gif/leaf.gif" },
//{ "../../TestImages/Formats/Gif/ani.gif" },
{ "../../TestImages/Formats/Gif/ani.gif" },
//{ "../../TestImages/Formats/Gif/ani2.gif" },
//{ "../../TestImages/Formats/Gif/giphy.gif" },
};

Loading…
Cancel
Save