mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Apply suggestions from code review
Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
This commit is contained in:
parent
44aca4dc6f
commit
0f43780c8c
@ -487,7 +487,8 @@ namespace Jellyfin.Drawing.Skia
|
|||||||
var height = newImageSize.Height;
|
var height = newImageSize.Height;
|
||||||
|
|
||||||
// scale image (the FromImage creates a copy)
|
// 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 now
|
// If all we're doing is resizing then we can stop now
|
||||||
if (!hasBackgroundColor && !hasForegroundColor && blur == 0 && !hasIndicator)
|
if (!hasBackgroundColor && !hasForegroundColor && blur == 0 && !hasIndicator)
|
||||||
|
@ -176,7 +176,8 @@ namespace Jellyfin.Drawing.Skia
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Scale image. The FromBitmap creates a copy
|
// 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 position
|
// draw this image into the strip at the next position
|
||||||
var xPos = x * cellWidth;
|
var xPos = x * cellWidth;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user