mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 09:34:44 +01:00
Add BlurHash support to backend
This commit is contained in:
@@ -43,6 +43,13 @@ namespace MediaBrowser.Controller.Drawing
|
||||
/// <returns>The image dimensions.</returns>
|
||||
ImageDimensions GetImageSize(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Get the blurhash of an image.
|
||||
/// </summary>
|
||||
/// <param name="path">The filepath of the image.</param>
|
||||
/// <returns>The blurhash.</returns>
|
||||
string GetImageHash(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Encode an image.
|
||||
/// </summary>
|
||||
|
||||
@@ -32,6 +32,13 @@ namespace MediaBrowser.Controller.Drawing
|
||||
/// <returns>ImageDimensions</returns>
|
||||
ImageDimensions GetImageDimensions(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the blurhash of the image.
|
||||
/// </summary>
|
||||
/// <param name="path">Path to the image file.</param>
|
||||
/// <returns>BlurHash</returns>
|
||||
String GetImageHash(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the dimensions of the image.
|
||||
/// </summary>
|
||||
|
||||
@@ -2222,6 +2222,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
existingImage.DateModified = image.DateModified;
|
||||
existingImage.Width = image.Width;
|
||||
existingImage.Height = image.Height;
|
||||
existingImage.Hash = image.Hash;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -28,6 +28,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public int Height { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the blurhash.
|
||||
/// </summary>
|
||||
/// <value>The blurhash.</value>
|
||||
public string Hash { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IsLocalFile => Path == null || !Path.StartsWith("http", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user