|
|
|
@ -135,7 +135,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms |
|
|
|
destSize.Height, |
|
|
|
image0.Height, |
|
|
|
Configuration.Default.MemoryAllocator); |
|
|
|
int minimumWorkerAllocationInBytes = verticalKernelMap.MaxDiameter * 2 * destSize.Width * SizeOfVector4; |
|
|
|
int minimumWorkerAllocationInBytes = verticalKernelMap.MaxDiameter * 2 * destSize.Width * SizeOfVector4; |
|
|
|
verticalKernelMap.Dispose(); |
|
|
|
|
|
|
|
using (Image<TPixel> image = image0.Clone(configuration)) |
|
|
|
@ -419,9 +419,10 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms |
|
|
|
using (Image<TPixel> image = provider.GetImage()) |
|
|
|
{ |
|
|
|
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)); |
|
|
|
|
|
|
|
@ -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] |
|
|
|
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)] |
|
|
|
public void ResizeWithMaxMode<TPixel>(TestImageProvider<TPixel> provider) |
|
|
|
@ -486,12 +507,12 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms |
|
|
|
using (Image<TPixel> image = provider.GetImage()) |
|
|
|
{ |
|
|
|
var options = new ResizeOptions |
|
|
|
{ |
|
|
|
Size = new Size( |
|
|
|
{ |
|
|
|
Size = new Size( |
|
|
|
(int)Math.Round(image.Width * .75F), |
|
|
|
(int)Math.Round(image.Height * .95F)), |
|
|
|
Mode = ResizeMode.Min |
|
|
|
}; |
|
|
|
Mode = ResizeMode.Min |
|
|
|
}; |
|
|
|
|
|
|
|
image.Mutate(x => x.Resize(options)); |
|
|
|
|
|
|
|
@ -508,9 +529,10 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms |
|
|
|
using (Image<TPixel> image = provider.GetImage()) |
|
|
|
{ |
|
|
|
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)); |
|
|
|
|
|
|
|
@ -527,9 +549,10 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms |
|
|
|
using (Image<TPixel> image = provider.GetImage()) |
|
|
|
{ |
|
|
|
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)); |
|
|
|
|
|
|
|
|