mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-27 17:01:16 -04:00
Skip missing images when creating collages (#14344)
* Skip missing images when creating collages
This commit is contained in:
parent
85f158e1dd
commit
db36be7a6b
1 changed files with 9 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue