|
|
@ -420,7 +420,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms |
|
|
{ |
|
|
{ |
|
|
var options = new ResizeOptions |
|
|
var options = new ResizeOptions |
|
|
{ |
|
|
{ |
|
|
Size = new Size(image.Width + 200, image.Height + 200), Mode = ResizeMode.BoxPad |
|
|
Size = new Size(image.Width + 200, image.Height + 200), |
|
|
|
|
|
Mode = ResizeMode.BoxPad |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
image.Mutate(x => x.Resize(options)); |
|
|
image.Mutate(x => x.Resize(options)); |
|
|
@ -462,6 +463,26 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Theory] |
|
|
|
|
|
[WithFile(TestImages.Jpeg.Issues.IncorrectResize1006, DefaultPixelType)] |
|
|
|
|
|
public void CanResizeLargeImageWithCropMode<TPixel>(TestImageProvider<TPixel> provider) |
|
|
|
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
|
|
|
{ |
|
|
|
|
|
using (Image<TPixel> image = provider.GetImage()) |
|
|
|
|
|
{ |
|
|
|
|
|
var options = new ResizeOptions |
|
|
|
|
|
{ |
|
|
|
|
|
Size = new Size(480, 600), |
|
|
|
|
|
Mode = ResizeMode.Crop |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
image.Mutate(x => x.Resize(options)); |
|
|
|
|
|
|
|
|
|
|
|
image.DebugSave(provider); |
|
|
|
|
|
image.CompareToReferenceOutput(ValidatorComparer, provider); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
[Theory] |
|
|
[Theory] |
|
|
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)] |
|
|
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)] |
|
|
public void ResizeWithMaxMode<TPixel>(TestImageProvider<TPixel> provider) |
|
|
public void ResizeWithMaxMode<TPixel>(TestImageProvider<TPixel> provider) |
|
|
@ -509,7 +530,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms |
|
|
{ |
|
|
{ |
|
|
var options = new ResizeOptions |
|
|
var options = new ResizeOptions |
|
|
{ |
|
|
{ |
|
|
Size = new Size(image.Width + 200, image.Height), Mode = ResizeMode.Pad |
|
|
Size = new Size(image.Width + 200, image.Height), |
|
|
|
|
|
Mode = ResizeMode.Pad |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
image.Mutate(x => x.Resize(options)); |
|
|
image.Mutate(x => x.Resize(options)); |
|
|
@ -528,7 +550,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms |
|
|
{ |
|
|
{ |
|
|
var options = new ResizeOptions |
|
|
var options = new ResizeOptions |
|
|
{ |
|
|
{ |
|
|
Size = new Size(image.Width / 2, image.Height), Mode = ResizeMode.Stretch |
|
|
Size = new Size(image.Width / 2, image.Height), |
|
|
|
|
|
Mode = ResizeMode.Stretch |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
image.Mutate(x => x.Resize(options)); |
|
|
image.Mutate(x => x.Resize(options)); |
|
|
|