This commit is contained in:
Joe Milazzo 2024-07-10 07:19:55 -05:00 committed by GitHub
parent e43b6110bb
commit c7f444a185
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 100 additions and 21 deletions

View file

@ -223,7 +223,7 @@ public class ImageService : IImageService
/// <summary>
/// Creates a thumbnail out of a memory stream and saves to <see cref="DirectoryService.CoverImageDirectory"/> with the passed
/// fileName and .png extension.
/// fileName and the appropriate extension.
/// </summary>
/// <param name="stream">Stream to write to disk. Ensure this is rewinded.</param>
/// <param name="fileName">filename to save as without extension</param>
@ -235,7 +235,6 @@ public class ImageService : IImageService
var (targetWidth, targetHeight) = size.GetDimensions();
if (stream.CanSeek) stream.Position = 0;
using var sourceImage = Image.NewFromStream(stream);
if (stream.CanSeek) stream.Position = 0;
var scalingSize = GetSizeForDimensions(sourceImage, targetWidth, targetHeight);
var scalingCrop = GetCropForDimensions(sourceImage, targetWidth, targetHeight);