Skip to content

Commit 715297c

Browse files
Fix WebP animation speed bug
`Milliseconds` is the milli seconds component of the TimeSpan, `TotalMilliseconds` is the entire TimeSpan expressed as milliseconds. Example, Timespan of 3.5 seconds: * `Milliseconds`: 500 * `TotalMilliseconds`: 3500
1 parent 1baba9e commit 715297c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ImageSharp/Formats/Webp/WebpFrameMetadata.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private WebpFrameMetadata(WebpFrameMetadata other)
4848
internal static WebpFrameMetadata FromAnimatedMetadata(AnimatedImageFrameMetadata metadata)
4949
=> new()
5050
{
51-
FrameDelay = (uint)metadata.Duration.Milliseconds,
51+
FrameDelay = (uint)metadata.Duration.TotalMilliseconds,
5252
BlendMethod = metadata.BlendMode == FrameBlendMode.Source ? WebpBlendMethod.Source : WebpBlendMethod.Over,
5353
DisposalMethod = metadata.DisposalMode == FrameDisposalMode.RestoreToBackground ? WebpDisposalMethod.RestoreToBackground : WebpDisposalMethod.DoNotDispose
5454
};

0 commit comments

Comments
 (0)