Skip to content

Padded image after Resizing in Mode.Min #892

@Obi-Dann

Description

@Obi-Dann

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 DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

When resizing an image that is smaller than the target image using Mode.Min, the resulting image is padded to be square instead of keeping the size of the original image.

I really don't feel like entering any other details, because the bug seems to be caused by a simple mistake - the Size is created using sourceWidth as width and height instead of using sourceWidth and sourceHeight.

return (new Size(sourceWidth, sourceWidth), new Rectangle(0, 0, sourceWidth, sourceHeight));

Going to create a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions