Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[iOS] Fix issue with gifs and differents DefaultThreadCurrentCulture #14698

Merged
merged 1 commit into from
Oct 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions Xamarin.Forms.Platform.iOS/Renderers/ImageAnimationHelper.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using CoreAnimation;
using Foundation;
using ImageIO;
using UIKit;

namespace Xamarin.Forms.Platform.iOS
{
Expand Down Expand Up @@ -51,9 +48,9 @@ public void AddFrameData(int index, CGImageSource imageSource)
using (var delayTimeValue = gifImageProperties?.ValueForKey(ImageIO.CGImageProperties.GIFDelayTime))
{
if (unclampedDelayTimeValue != null)
double.TryParse(unclampedDelayTimeValue.ToString(), out delayTime);
double.TryParse(unclampedDelayTimeValue.ToString(), NumberStyles.Any, CultureInfo.InvariantCulture, out delayTime);
else if (delayTimeValue != null)
double.TryParse(delayTimeValue.ToString(), out delayTime);
double.TryParse(delayTimeValue.ToString(), NumberStyles.Any, CultureInfo.InvariantCulture, out delayTime);

// Frame delay compability adjustment.
if (delayTime <= 0.02f)
Expand Down