BUG-2111: The where clause selecting the possible images didn't work correctly.

This commit is contained in:
Robin 2017-01-13 22:25:40 +01:00
parent b01eae3794
commit c4139f4fe2

View file

@ -813,10 +813,10 @@ EndSelection:<<<<<<<4
string[] dropFileNames = (string[]) dataObject.GetData(DataFormats.FileDrop);
if (dropFileNames != null && dropFileNames.Length > 0)
{
return dropFileNames.Where(filename => !string.IsNullOrEmpty(filename))
return dropFileNames
.Where(filename => !string.IsNullOrEmpty(filename))
.Where(Path.HasExtension)
.Select(filename => Path.GetExtension(filename).ToLowerInvariant())
.Where(ext => ImageHelper.StreamConverters.Keys.Contains(ext));
.Where(filename => ImageHelper.StreamConverters.Keys.Contains(Path.GetExtension(filename).ToLowerInvariant().Substring(1)));
}
return Enumerable.Empty<string>();
}