Skip to content

smartcrop: bad extract area #1134

@pieh

Description

@pieh

In very specific case resizing with cropping set to sharp.strategy.attention or sharp.strategy.entropy will result with error smartcrop: bad extract area

Repository to reproduce - https://github.com/pieh/sharp-smartcrop-bad-extract-area-repro

This happens when width is set to 1110 and height is unspecified using image from above repository (it is 1600 x 1200)

In readme of repository I placed more outputs where it works fine:

  • with crop set to sharp.gravity.center
  • with slightly higher and lower widths (1120 and 1100 respectively)
  • with specified height (both calculated using source image aspect ratio and full image height)

This was originally reported in gatsbyjs/gatsby#4142 (just to keep paper trail - reproduction repository should be enough)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions