-
-
Couldn't load subscription status.
- Fork 888
Closed
Labels
Description
Prerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of ImageSharp
- I have verified if the problem exist in both
DEBUGandRELEASEmode - I have searched open and closed issues to ensure it has not already been reported
Description
I'm resizing images of varying dimensions to a maximum height of 450px (any width), often the image produced is actually 451px high.
Steps to Reproduce
As an example, with this image: https://sample-videos.com/img/Sample-jpg-image-5mb.jpg
using (Image image = Image.Load(imgFile))
{
image.Mutate(x =>
x.Resize(
new ResizeOptions()
{
Mode = ResizeMode.Max,
Size = new Size() { Height = 450 }
}
)
);
image.Save(outImgFile2)
}This produces an image from 5072x6761px -> 338x451px exceeding the maximum 450 height specified.
As a work around, If I also specify a width, i.e.
using (Image image = Image.Load(imgFile))
{
image.Mutate(x =>
x.Resize(
new ResizeOptions()
{
Mode = ResizeMode.Max,
Size = new Size(int.MaxValue, 450)
}
)
);
image.Save(outImgFile2)
}It produces an image of 338x450px as expected.
Is the first example the intended behaviour or is it a bug?
System Configuration
- ImageSharp version: SixLabors.ImageSharp 1.0.0-beta0007
- Other ImageSharp packages and versions: n/a
- Environment (Operating system, version and so on): Windows 10
- .NET Framework version: .NET Core 2.2
antonfirsovJimBobSquarePants