Skip to content

Exact sizing not respected #94

Open
@peacechen

Description

@peacechen

Describe the bug
Passing in a width value to both maxWidth & minWidth, as well as a height to both maxHeight & minHeight, does not resize to the desired width & height values. It appears to prioritize minWidth/minHeight and ignore max.

@onurzorluer Would you merge a PR that fixes this?

To Reproduce
Steps to reproduce the behavior:

    Resizer.imageFileResizer(
      file,
      1024, // maxWidth
      768, // maxHeight
      "PNG",
      100,
      0,
      async resizedBlob => resolve(resizedBlob as Blob),
      "blob",
      1024, // minWidth
      768, // minHeight
    );

The resulting image has the dimensions 1365 x 1024 instead of 1024 x 768. It should ignore the original aspect ratio and resize to the provided values.

Expected behavior
Output image should be 1024 x 768.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: 123.0.6312.107

Additional context
NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions