diff --git a/src/ImageSharp/Image/ImageFrameCollection.cs b/src/ImageSharp/Image/ImageFrameCollection.cs index 65f52f9221..bfd8e5e91d 100644 --- a/src/ImageSharp/Image/ImageFrameCollection.cs +++ b/src/ImageSharp/Image/ImageFrameCollection.cs @@ -17,14 +17,6 @@ namespace SixLabors.ImageSharp where TPixel : struct, IPixel { private readonly IList> frames = new List>(); - private readonly int parentWidth; - private readonly int parentHeight; - - internal ImageFrameCollection(Image parent) - { - this.parentWidth = parent.Width; - this.parentHeight = parent.Height; - } /// /// Gets the count. @@ -103,7 +95,7 @@ namespace SixLabors.ImageSharp { if (this.Count != 0) { - if (this.parentWidth != frame.Width || this.parentHeight != frame.Height) + if (this.RootFrame.Width != frame.Width || this.RootFrame.Height != frame.Height) { throw new ArgumentException("Frame must have the same dimensions as the image", nameof(frame)); } diff --git a/src/ImageSharp/Image/Image{TPixel}.cs b/src/ImageSharp/Image/Image{TPixel}.cs index 0b33528691..1b8f8ec28d 100644 --- a/src/ImageSharp/Image/Image{TPixel}.cs +++ b/src/ImageSharp/Image/Image{TPixel}.cs @@ -1,22 +1,14 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; -using System.Collections; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; -using System.Numerics; -using System.Text; -using System.Threading.Tasks; -using SixLabors.ImageSharp.Advanced; + using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; -using SixLabors.Primitives; namespace SixLabors.ImageSharp { @@ -81,7 +73,7 @@ namespace SixLabors.ImageSharp this.ImageConfiguration = configuration ?? Configuration.Default; this.MetaData = metadata ?? new ImageMetaData(); - this.Frames = new ImageFrameCollection(this); + this.Frames = new ImageFrameCollection(); if (frames != null) {