Skip to content

Trim() cuts portions of the actual image #2363

@KrishKayc

Description

@KrishKayc

Hi,

We are using the trim() function to get rid of extra white space around the image.

But there is a recent issue we noticed. Trim() removes the portion of the image. Please find the attached screenshots of the actual image and the image after using Trim().

Note that the dot in the end of the first line gets cut. (after answer, see that portion of 'r' in answer along with the ending fullstop gets cut)

tux
tux_edited

The code that I use is as follows.

sharp(buffer).trim()

Have tried giving threshold for trim with values like 1, 5 12 etc but nothing works. Have tried resize but that does not do the trimming .Please suggest if there is anyother work around to this.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions