Skip to content

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

Closed
@swapnilmmane

Description

@swapnilmmane

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions