diff options
| author | Bond-009 <bond.009@outlook.com> | 2025-02-03 17:07:12 -0500 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2025-02-03 17:07:12 -0500 |
| commit | 10f4f8b2ab727f6a0b30b7e8edcc6c9d47205add (patch) | |
| tree | 825e556eef75a4cbd05e2a998bc02d2aecac3cd8 /src | |
| parent | c05a41cc3c208b078950452357b65161080eb1bd (diff) | |
Backport pull request #13425 from jellyfin/release-10.10.z
Open files with FileShare.Read for BlurHash calculations
Original-merge: bfe0fdbcdca03436a08430d723fc2b34a6016e25
Merged-by: crobibero <cody@robibe.ro>
Backported-by: Bond_009 <bond.009@outlook.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/Jellyfin.Drawing.Skia/SkiaEncoder.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Jellyfin.Drawing.Skia/SkiaEncoder.cs b/src/Jellyfin.Drawing.Skia/SkiaEncoder.cs index c5aadc890..2dac5598f 100644 --- a/src/Jellyfin.Drawing.Skia/SkiaEncoder.cs +++ b/src/Jellyfin.Drawing.Skia/SkiaEncoder.cs @@ -195,8 +195,10 @@ public class SkiaEncoder : IImageEncoder return string.Empty; } + // Use FileStream with FileShare.Read instead of having Skia open the file to allow concurrent read access + using var fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); // Any larger than 128x128 is too slow and there's no visually discernible difference - return BlurHashEncoder.Encode(xComp, yComp, path, 128, 128); + return BlurHashEncoder.Encode(xComp, yComp, fileStream, 128, 128); } private bool RequiresSpecialCharacterHack(string path) |
