Reset source memory stream

This commit is contained in:
Timothy Baldridge 2022-05-14 22:40:40 -06:00
parent 0e99dce23e
commit 0626fd2899

View File

@ -260,11 +260,9 @@ public class ValidateLists : IVerb
await using var imageStream = await _httpClient.GetStreamAsync(validatedList.Links.ImageUri, token); await using var imageStream = await _httpClient.GetStreamAsync(validatedList.Links.ImageUri, token);
var ms = new MemoryStream(); var ms = new MemoryStream();
var hash = await imageStream.HashingCopy(ms, token); var hash = await imageStream.HashingCopy(ms, token);
ms.Position = 0;
RelativePath smallImage, largeImage; RelativePath smallImage, largeImage;
ms.Position = 0;
// Large Image // Large Image
{ {
var standardWidth = 1152; var standardWidth = 1152;
@ -275,7 +273,8 @@ public class ValidateLists : IVerb
largeImage = validatedList.RepositoryName.ToRelativePath().Combine(hash.ToHex()+"_large").WithExtension(Ext.Webp); largeImage = validatedList.RepositoryName.ToRelativePath().Combine(hash.ToHex()+"_large").WithExtension(Ext.Webp);
await image.SaveAsync(largeImage.RelativeTo(reports).ToString(), cancellationToken: token); await image.SaveAsync(largeImage.RelativeTo(reports).ToString(), cancellationToken: token);
} }
ms.Position = 0;
// Small Image // Small Image
{ {
var standardWidth = 466; var standardWidth = 466;