@@ -130,7 +130,7 @@ internal Image(Configuration configuration, ImageMetadata metadata, IEnumerable<
130130 protected override ImageFrameCollection NonGenericFrameCollection => this . Frames ;
131131
132132 /// <summary>
133- /// Gets the frames.
133+ /// Gets the collection of image frames.
134134 /// </summary>
135135 public new ImageFrameCollection < TPixel > Frames { get ; }
136136
@@ -166,8 +166,12 @@ public Image<TPixel> Clone(Configuration configuration)
166166 {
167167 this . EnsureNotDisposed ( ) ;
168168
169- IEnumerable < ImageFrame < TPixel > > clonedFrames =
170- this . Frames . Select < ImageFrame < TPixel > , ImageFrame < TPixel > > ( x => x . Clone ( configuration ) ) ;
169+ var clonedFrames = new ImageFrame < TPixel > [ this . Frames . Count ] ;
170+ for ( int i = 0 ; i < clonedFrames . Length ; i ++ )
171+ {
172+ clonedFrames [ i ] = this . Frames [ i ] . Clone ( configuration ) ;
173+ }
174+
171175 return new Image < TPixel > ( configuration , this . Metadata . DeepClone ( ) , clonedFrames ) ;
172176 }
173177
@@ -181,8 +185,12 @@ public override Image<TPixel2> CloneAs<TPixel2>(Configuration configuration)
181185 {
182186 this . EnsureNotDisposed ( ) ;
183187
184- IEnumerable < ImageFrame < TPixel2 > > clonedFrames =
185- this . Frames . Select < ImageFrame < TPixel > , ImageFrame < TPixel2 > > ( x => x . CloneAs < TPixel2 > ( configuration ) ) ;
188+ var clonedFrames = new ImageFrame < TPixel2 > [ this . Frames . Count ] ;
189+ for ( int i = 0 ; i < clonedFrames . Length ; i ++ )
190+ {
191+ clonedFrames [ i ] = this . Frames [ i ] . CloneAs < TPixel2 > ( configuration ) ;
192+ }
193+
186194 return new Image < TPixel2 > ( configuration , this . Metadata . DeepClone ( ) , clonedFrames ) ;
187195 }
188196
0 commit comments