diff --git a/src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsFixedPageReaderWriter.cs b/src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsFixedPageReaderWriter.cs index af81fd485..ece7f5c71 100644 --- a/src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsFixedPageReaderWriter.cs +++ b/src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsFixedPageReaderWriter.cs @@ -1867,23 +1867,22 @@ Uri imageUri ) { //Extract file extension without '.' - String path = imageUri.OriginalString; - ReadOnlySpan extension = Path.GetExtension(path).ToLower(CultureInfo.InvariantCulture).AsSpan(1); - + ReadOnlySpan path = imageUri.OriginalString.AsSpan(); + ReadOnlySpan extension = Path.GetExtension(path).Slice(1); ContentType contentType; - if (extension.Equals(XpsS0Markup.JpgExtension, StringComparison.Ordinal)) + if (extension.Equals(XpsS0Markup.JpgExtension, StringComparison.OrdinalIgnoreCase)) { - contentType = XpsS0Markup.JpgContentType; + contentType = XpsS0Markup.JpgContentType; } - else if (extension.Equals(XpsS0Markup.PngExtension, StringComparison.Ordinal)) + else if (extension.Equals(XpsS0Markup.PngExtension, StringComparison.OrdinalIgnoreCase)) { contentType = XpsS0Markup.PngContentType; } - else if (extension.Equals(XpsS0Markup.TifExtension, StringComparison.Ordinal)) + else if (extension.Equals(XpsS0Markup.TifExtension, StringComparison.OrdinalIgnoreCase)) { contentType = XpsS0Markup.TifContentType; } - else if (extension.Equals(XpsS0Markup.WdpExtension, StringComparison.Ordinal)) + else if (extension.Equals(XpsS0Markup.WdpExtension, StringComparison.OrdinalIgnoreCase)) { contentType = XpsS0Markup.WdpContentType; } @@ -1892,9 +1891,8 @@ Uri imageUri //default to PNG contentType = XpsS0Markup.PngContentType; } - return contentType; - } + } ///