Skip to content

Commit a8d69c7

Browse files
committed
Add support when image format is not support
1 parent 129169e commit a8d69c7

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Flow.Launcher.Infrastructure/Image/ImageLoader.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,15 @@ private static ImageResult GetThumbnailResult(ref string path, bool loadFullImag
215215
type = ImageType.ImageFile;
216216
if (loadFullImage)
217217
{
218-
image = LoadFullImage(path);
219-
type = ImageType.FullImageFile;
218+
try
219+
{
220+
image = LoadFullImage(path);
221+
type = ImageType.FullImageFile;
222+
}
223+
catch (NotSupportedException)
224+
{
225+
image = null;
226+
}
220227
}
221228
else
222229
{
@@ -242,7 +249,7 @@ private static ImageResult GetThumbnailResult(ref string path, bool loadFullImag
242249

243250
if (type != ImageType.Error)
244251
{
245-
image.Freeze();
252+
image?.Freeze();
246253
}
247254

248255
return new ImageResult(image, type);

0 commit comments

Comments
 (0)