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 82d3906 commit ba57cf3Copy full SHA for ba57cf3
src/ImageSharp/Formats/ImageFormatManager.cs
@@ -102,9 +102,12 @@ 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 (extension[0] == '.')
+ if (!string.IsNullOrWhiteSpace(extension))
106
107
- extension = extension[1..];
+ if (extension[0] == '.')
108
+ {
109
+ extension = extension[1..];
110
+ }
111
}
112
113
format = this.imageFormats.FirstOrDefault(x =>
0 commit comments