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 {