diff options
| author | Tim Eisele <Ghost_of_Stone@web.de> | 2025-06-21 12:23:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-21 12:23:08 +0200 |
| commit | db36be7a6b8a7364c0fb99a57251e4501351ef0f (patch) | |
| tree | b506fa2310bdb3ee83f7852f6103a1112ee25741 /src/Jellyfin.Drawing.Skia/SkiaHelper.cs | |
| parent | 85f158e1dd704e673f46d039fddfb8162de33cc3 (diff) | |
Skip missing images when creating collages (#14344)
* Skip missing images when creating collages
Diffstat (limited to 'src/Jellyfin.Drawing.Skia/SkiaHelper.cs')
| -rw-r--r-- | src/Jellyfin.Drawing.Skia/SkiaHelper.cs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Jellyfin.Drawing.Skia/SkiaHelper.cs b/src/Jellyfin.Drawing.Skia/SkiaHelper.cs index bd1b2b0da..87446236c 100644 --- a/src/Jellyfin.Drawing.Skia/SkiaHelper.cs +++ b/src/Jellyfin.Drawing.Skia/SkiaHelper.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.IO; using SkiaSharp; namespace Jellyfin.Drawing.Skia; @@ -27,12 +28,17 @@ public static class SkiaHelper currentIndex = 0; } - SKBitmap? bitmap = skiaEncoder.Decode(paths[currentIndex], false, null, out _); - + var imagePath = paths[currentIndex]; imagesTested[currentIndex] = 0; - currentIndex++; + if (!Path.Exists(imagePath)) + { + continue; + } + + SKBitmap? bitmap = skiaEncoder.Decode(imagePath, false, null, out _); + if (bitmap is not null) { newIndex = currentIndex; |
