Skip to content

/fit-in not working with 4.0.0 #114

Closed
@tjw0051

Description

@tjw0051

Using /fit-in/AxB/ is cropping images rather than fitting them within the dimensions specified.

Example: https://i1rk6c9qi5.execute-api.us-east-1.amazonaws.com/image/100x100/bart.png

A workaround to fit an image into the resize area is to use the upscale filter:

https://i1rk6c9qi5.execute-api.us-east-1.amazonaws.com/image/200x50/filters:upscale()/bart.png

The fix for this might be in the process(event) function:

https://github.com/awslabs/serverless-image-handler/blob/a1b3eb659807599eaec88fb8df21bc34a45b93ee/source/image-handler/thumbor-mapping.js#L27-L38

... the this.edits.resize.fit = 'inside' needs to be set, the same as what happens in the upscale() filter.

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