Skip to content

Upgrade sharp to 0.33.4#193

Closed
joehoyle wants to merge 2 commits into
masterfrom
sharp-0.33.4
Closed

Upgrade sharp to 0.33.4#193
joehoyle wants to merge 2 commits into
masterfrom
sharp-0.33.4

Conversation

@joehoyle

Copy link
Copy Markdown
Member

No description provided.

@joehoyle

Copy link
Copy Markdown
Member Author

This appears to be an issue with lovell/sharp#4163 with pre-built binaries

@lovell

lovell commented Jul 27, 2024

Copy link
Copy Markdown

I think this might be due to the overly-restrictive peerDependencies of the smartcrop-sharp dependency - see jwagner/smartcrop-sharp#32

If you weren't already aware, sharp provides a smartcrop feature via a position of "entropy" or "attention".

await sharp(input).resize({ width, height, position: "entropy" })...

https://sharp.pixelplumbing.com/api-resize#resize

@rmccue

rmccue commented Aug 2, 2024

Copy link
Copy Markdown
Member

Thanks @lovell (and thanks for the great library!). Might be a good idea for us to reduce our dependencies here if the behaviour is equivalent.

I'm not sure to the extent we're using smart cropping, or what the impact of switching would be; the only mention of it in tachyon-plugin in the docs, albeit we appear to be using it in smart-media for resizes (but not crops).

@roborourke Any insight on this?

@roborourke

Copy link
Copy Markdown
Contributor

The behaviour isn’t equivalent unfortunately or I would agree on reducing dependencies. The smartcrop-sharp library is a wrapper around https://github.com/jwagner/smartcrop.js so we could perhaps switch to using that directly instead to avoid the extra dependency.

The smartcrop.js results are generally better in my testing than entropy or attention especially when it comes to faces and people which is why I implemented it in Tachyon and used it as the default in Altis.

@joehoyle

Copy link
Copy Markdown
Member Author

Close as stale

@joehoyle joehoyle closed this Jan 14, 2026
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

Successfully merging this pull request may close these issues.

4 participants