The Free Software Media System - Server Backend & API
Apply suggestions from code review
Erwin de Haan0f43780c8c50
diff --git a/Jellyfin.Drawing.Skia/SkiaEncoder.cs b/Jellyfin.Drawing.Skia/SkiaEncoder.csindex 62e1d6ed14..a1caa751b1 100644--- a/Jellyfin.Drawing.Skia/SkiaEncoder.cs+++ b/Jellyfin.Drawing.Skia/SkiaEncoder.cs@@ -487,7 +487,8 @@ namespace Jellyfin.Drawing.Skiavar height = newImageSize.Height;// scale image (the FromImage creates a copy)- using var resizedBitmap = SKBitmap.FromImage(ResizeImage(bitmap, new SKImageInfo(width, height, bitmap.ColorType, bitmap.AlphaType, bitmap.ColorSpace)));+ var imageInfo = new SKImageInfo(width, height, bitmap.ColorType, bitmap.AlphaType, bitmap.ColorSpace);+ using var resizedBitmap = SKBitmap.FromImage(ResizeImage(bitmap, imageInfo));// If all we're doing is resizing then we can stop nowif (!hasBackgroundColor && !hasForegroundColor && blur == 0 && !hasIndicator)diff --git a/Jellyfin.Drawing.Skia/StripCollageBuilder.cs b/Jellyfin.Drawing.Skia/StripCollageBuilder.csindex 3b35594865..b08c3750d7 100644--- a/Jellyfin.Drawing.Skia/StripCollageBuilder.cs+++ b/Jellyfin.Drawing.Skia/StripCollageBuilder.cs@@ -176,7 +176,8 @@ namespace Jellyfin.Drawing.Skia}// Scale image. The FromBitmap creates a copy- using var resizedBitmap = SKBitmap.FromImage(SkiaEncoder.ResizeImage(bitmap, new SKImageInfo(cellWidth, cellHeight, currentBitmap.ColorType, currentBitmap.AlphaType, currentBitmap.ColorSpace)));+ var imageInfo = new SKImageInfo(cellWidth, cellHeight, currentBitmap.ColorType, currentBitmap.AlphaType, currentBitmap.ColorSpace);+ using var resizedBitmap = SKBitmap.FromImage(SkiaEncoder.ResizeImage(bitmap, imageInfo));// draw this image into the strip at the next positionvar xPos = x * cellWidth;