summaryrefslogtreecommitdiff
path: root/Controllers
diff options
context:
space:
mode:
Diffstat (limited to 'Controllers')
-rw-r--r--Controllers/MediaController.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Controllers/MediaController.cs b/Controllers/MediaController.cs
index 6e04670..674b406 100644
--- a/Controllers/MediaController.cs
+++ b/Controllers/MediaController.cs
@@ -56,13 +56,15 @@ public class MediaController : Controller {
if(w > image.Width || h > image.Height)
return BadRequest("Requested thumbnail size is larger than original media");
- int width = (int)(w is not null ? w : image.Width * h / image.Height);
+ #pragma warning disable CS8629
+ int width = (int)(w is not null ? w : image.Width * h / image.Height);
int height = (int)(h is not null ? h : image.Height * w / image.Width);
+ #pragma warning restore CS8629
var thumbPath = mediaService.GetPath(media, width, height);
if(!System.IO.File.Exists(thumbPath)) {
- image.Resize(new MagickGeometry(width, height));
+ image.Resize(width, height);
image.Write(thumbPath);
}