Skip to content

Padded image after Resizing in Mode.Min #892

Closed

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.

Activity

  1. added this to the 1.0.0-rc1 milestone on Apr 23, 2019
  2. JimBobSquarePants commented on Apr 23, 2019

    @JimBobSquarePants
    Member

    Yup that's a bug! Thanks for the PR. 👍

  3. added a commit that references this issue on Aug 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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