Skip to content

Commit 61b5b0c

Browse files
committed
Fix incorrect acTL frame count
1 parent c5ebbfe commit 61b5b0c

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
@@ -196,7 +196,7 @@ public void Encode<TPixel>(Image<TPixel> image, Stream stream, CancellationToken
196196

197197
if (image.Frames.Count > 1)
198198
{
199-
this.WriteAnimationControlChunk(stream, (uint)image.Frames.Count, pngMetadata.RepeatCount);
199+
this.WriteAnimationControlChunk(stream, (uint)(image.Frames.Count - (pngMetadata.DefaultImageAnimated ? 0 : 1)), pngMetadata.RepeatCount);
200200
}
201201

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

0 commit comments

Comments
 (0)