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

Image scaling not working if image name contains 'x' alphabet #163

Closed
swapnilmmane opened this issue Nov 23, 2019 · 2 comments
Closed

Image scaling not working if image name contains 'x' alphabet #163

swapnilmmane opened this issue Nov 23, 2019 · 2 comments

Comments

@swapnilmmane
Copy link

If the image name contains x alphabet in its name, the scaling is not as expected.

The reason for this issue is code in process(event) function of thumbor-mapping.js file

else if (edit.includes('x')) {
    this.edits.resize = {};
    const dims = edit.split('x');
    this.edits.resize.width = Number(dims[0]);
    this.edits.resize.height = Number(dims[1]);
}

Now due to this code, if the image name contain x alphabet, the value of 'this.edits.resize.width' and this.edits.resize.height set as NaN.

Thus the system is unable to scale the image.

e.g. URL https://.cloudfront.net/300x300/demoxname.jpg

@mohsenari
Copy link

Hi @swapnilmmane Thanks for finding this issue. We confirmed that this is a bug and added to our backlog for fix.

@beomseoklee
Copy link
Member

We have updated our solution, and I believe your issue has been fixed. If you still see the issue with the latest version (v4.2), please feel free to reopen the issue.

You can refer to the recent changes here

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

No branches or pull requests

4 participants