Browse Source

Ensure properties are copied across.

Former-commit-id: 74c60bd0d577cf129089f38f701392853b85e814
Former-commit-id: 41bf82cf3966e17d5dd5e08d24b4ad8be4ac2da0
Former-commit-id: ee471ffb719aeba1cc004e55a08470dda2442484
af/merge-core
James Jackson-South 10 years ago
parent
commit
4f080a9205
  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