fix(backend): *actually* correctly hash images
This commit is contained in:
parent
14e6e35cb7
commit
e20a7d3465
4 changed files with 11 additions and 12 deletions
|
@ -31,8 +31,7 @@ public class UserAvatarUpdateInvocable(DatabaseContext db, ObjectStorageService
|
|||
|
||||
try
|
||||
{
|
||||
var image = await newAvatar.ConvertBase64UriToImage(size: 512, crop: true);
|
||||
var hash = Convert.ToHexString(await SHA256.HashDataAsync(image)).ToLower();
|
||||
var (hash, image) = await newAvatar.ConvertBase64UriToImage(size: 512, crop: true);
|
||||
image.Seek(0, SeekOrigin.Begin);
|
||||
var prevHash = user.Avatar;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue