Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exact sizing not respected #94

Open
peacechen opened this issue May 17, 2024 · 0 comments · May be fixed by #96
Open

Exact sizing not respected #94

peacechen opened this issue May 17, 2024 · 0 comments · May be fixed by #96

Comments

@peacechen
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant