Skip to content

Commit ceb7dc0

Browse files
committed
Fix incorrect acTL frame count
1 parent 9ae8be4 commit ceb7dc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ImageSharp/Formats/Png/PngEncoderCore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public void Encode<TPixel>(Image<TPixel> image, Stream stream, CancellationToken
190190

191191
if (image.Frames.Count > 1)
192192
{
193-
this.WriteAnimationControlChunk(stream, (uint)image.Frames.Count, pngMetadata.RepeatCount);
193+
this.WriteAnimationControlChunk(stream, (uint)(image.Frames.Count - (pngMetadata.DefaultImageAnimated ? 0 : 1)), pngMetadata.RepeatCount);
194194
}
195195

196196
// If the first frame isn't animated, write it as usual and skip it when writing animated frames

0 commit comments

Comments
 (0)