mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Open files with FileShare.Read for BlurHash calculations (#13425)
This commit is contained in:
parent
0b2a59e963
commit
bfe0fdbcdc
@ -9,8 +9,8 @@
|
||||
<PackageVersion Include="AutoFixture.Xunit2" Version="4.18.1" />
|
||||
<PackageVersion Include="AutoFixture" Version="4.18.1" />
|
||||
<PackageVersion Include="BDInfo" Version="0.8.0" />
|
||||
<PackageVersion Include="BlurHashSharp.SkiaSharp" Version="1.3.3" />
|
||||
<PackageVersion Include="BlurHashSharp" Version="1.3.3" />
|
||||
<PackageVersion Include="BlurHashSharp.SkiaSharp" Version="1.3.4" />
|
||||
<PackageVersion Include="BlurHashSharp" Version="1.3.4" />
|
||||
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
|
||||
<PackageVersion Include="Diacritics" Version="3.3.29" />
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user