mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-10 15:50:35 +02:00
Fix collages
This commit is contained in:
parent
75bb127599
commit
1dcc678a6a
|
@ -115,7 +115,7 @@ namespace Jellyfin.Drawing.Skia
|
||||||
|
|
||||||
// resize to the same aspect as the original
|
// resize to the same aspect as the original
|
||||||
int iWidth = Math.Abs(iHeight * currentBitmap.Width / currentBitmap.Height);
|
int iWidth = Math.Abs(iHeight * currentBitmap.Width / currentBitmap.Height);
|
||||||
using var resizedImage = SkiaEncoder.ResizeImage(bitmap, new SKImageInfo(iWidth, iHeight, currentBitmap.ColorType, currentBitmap.AlphaType, currentBitmap.ColorSpace));
|
using var resizedImage = SkiaEncoder.ResizeImage(currentBitmap, new SKImageInfo(iWidth, iHeight, currentBitmap.ColorType, currentBitmap.AlphaType, currentBitmap.ColorSpace));
|
||||||
|
|
||||||
// crop image
|
// crop image
|
||||||
int ix = Math.Abs((iWidth - iSlice) / 2);
|
int ix = Math.Abs((iWidth - iSlice) / 2);
|
||||||
|
@ -177,7 +177,7 @@ namespace Jellyfin.Drawing.Skia
|
||||||
|
|
||||||
// Scale image. The FromBitmap creates a copy
|
// Scale image. The FromBitmap creates a copy
|
||||||
var imageInfo = 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));
|
using var resizedBitmap = SKBitmap.FromImage(SkiaEncoder.ResizeImage(currentBitmap, 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…
Reference in a new issue