[backend/drive] Fix ImageSharp image scaling for horizontal images
This commit is contained in:
parent
1637064d60
commit
8889510811
1 changed files with 4 additions and 4 deletions
|
@ -106,12 +106,12 @@ public class ImageSharpProcessor : ImageProcessorBase, IImageProcessor
|
||||||
}
|
}
|
||||||
|
|
||||||
private Image<TPixel> GetImage<TPixel>(
|
private Image<TPixel> GetImage<TPixel>(
|
||||||
byte[] data, IImageInfo ident, int width, int? height = null, bool preferContiguous = false
|
byte[] data, IImageInfo ident, int targetWidth, int? targetHeight = null, bool preferContiguous = false
|
||||||
) where TPixel : unmanaged, IPixel<TPixel>
|
) where TPixel : unmanaged, IPixel<TPixel>
|
||||||
{
|
{
|
||||||
width = Math.Min(ident.Width, width);
|
var width = Math.Min(ident.Width, targetWidth);
|
||||||
height = Math.Min(ident.Height, height ?? width);
|
var height = Math.Min(ident.Height, targetHeight ?? targetWidth);
|
||||||
var size = new Size(width, height.Value);
|
var size = new Size(width, height);
|
||||||
var options = new DecoderOptions
|
var options = new DecoderOptions
|
||||||
{
|
{
|
||||||
MaxFrames = 1,
|
MaxFrames = 1,
|
||||||
|
|
Loading…
Add table
Reference in a new issue