We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba57cf3 commit 1ccad09Copy full SHA for 1ccad09
src/ImageSharp/Formats/ImageFormatManager.cs
@@ -102,12 +102,9 @@ public void AddImageFormat(IImageFormat format)
102
/// <returns><see langword="true"/> if a match is found; otherwise, <see langword="false"/></returns>
103
public bool TryFindFormatByFileExtension(string extension, [NotNullWhen(true)] out IImageFormat? format)
104
{
105
- if (!string.IsNullOrWhiteSpace(extension))
+ if (!string.IsNullOrWhiteSpace(extension) && extension[0] == '.')
106
107
- if (extension[0] == '.')
108
- {
109
- extension = extension[1..];
110
- }
+ extension = extension[1..];
111
}
112
113
format = this.imageFormats.FirstOrDefault(x =>
0 commit comments