Switched to ThumbHasher over BlurHasher

This commit is contained in:
2023-05-21 23:56:10 -07:00
parent 514637b9c6
commit a0c880c7ba
26 changed files with 803 additions and 121 deletions

View File

@ -0,0 +1,10 @@
namespace View_by_Distance.Shared.Models.Methods;
public interface IThumbHasher
{
byte[] Encode(string path);
(byte[], MemoryStream) EncodeAndSave(string path, int width, int height);
MemoryStream GetMemoryStream(byte[] thumbHashBytes, int width, int height);
}

View File

@ -3,7 +3,6 @@ namespace View_by_Distance.Shared.Models.Properties;
public interface IProperty
{
public string? BlurHash { init; get; }
public DateTime CreationTime { init; get; }
public DateTime? DateTime { init; get; }
public DateTime? DateTimeDigitized { init; get; }
@ -17,6 +16,7 @@ public interface IProperty
public string? Make { init; get; }
public string? Model { init; get; }
public string? Orientation { init; get; }
public byte[]? ThumbHashBytes { init; get; }
public int? Width { init; get; }
}

View File

@ -6,7 +6,6 @@ namespace View_by_Distance.Shared.Models;
public class Property : Properties.IProperty
{
public string? BlurHash { init; get; }
public DateTime CreationTime { init; get; }
public DateTime? DateTime { init; get; }
public DateTime? DateTimeDigitized { init; get; }
@ -20,12 +19,12 @@ public class Property : Properties.IProperty
public string? Make { init; get; }
public string? Model { init; get; }
public string? Orientation { init; get; }
public byte[]? ThumbHashBytes { init; get; }
public int? Width { init; get; }
[JsonConstructor]
public Property(string? blurHash, DateTime creationTime, DateTime? dateTime, DateTime? dateTimeDigitized, DateTime? dateTimeFromName, DateTime? dateTimeOriginal, long fileSize, DateTime? gpsDateStamp, int? height, int? id, DateTime lastWriteTime, string? make, string? model, string? orientation, int? width)
public Property(DateTime creationTime, DateTime? dateTime, DateTime? dateTimeDigitized, DateTime? dateTimeFromName, DateTime? dateTimeOriginal, long fileSize, DateTime? gpsDateStamp, int? height, int? id, DateTime lastWriteTime, string? make, string? model, string? orientation, byte[]? thumbHashBytes, int? width)
{
BlurHash = blurHash;
DateTimeFromName = dateTimeFromName;
CreationTime = creationTime;
DateTime = dateTime;
@ -39,6 +38,7 @@ public class Property : Properties.IProperty
Make = make;
Model = model;
Orientation = orientation;
ThumbHashBytes = thumbHashBytes;
Width = width;
}