From 0e465102f47ddb6af3032d979e25e3d5841a43c0 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Tue, 6 Sep 2022 23:54:44 +1000 Subject: [PATCH] Use culture for NET 7 --- src/ImageSharp/Formats/Png/PngDecoderCore.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index b7cd5dd932..3d9fc68fa0 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -4,6 +4,7 @@ using System; using System.Buffers; using System.Buffers.Binary; +using System.Globalization; using System.IO; using System.IO.Compression; using System.Runtime.CompilerServices; @@ -1258,7 +1259,7 @@ namespace SixLabors.ImageSharp.Formats.Png /// /// The to parse. /// The parsed . - private static int ParseInt32(ReadOnlySpan span) => int.Parse(span); + private static int ParseInt32(ReadOnlySpan span) => int.Parse(span, provider: CultureInfo.InvariantCulture); /// /// Sets the in to , @@ -1358,8 +1359,7 @@ namespace SixLabors.ImageSharp.Formats.Png } else if (IsXmpTextData(keywordBytes)) { - XmpProfile xmpProfile = new(data[dataStartIdx..].ToArray()); - metadata.XmpProfile = xmpProfile; + metadata.XmpProfile = new XmpProfile(data[dataStartIdx..].ToArray()); } else {