Skip to content

feat(gatsby-plugin-sharp): reduce encoding time and install size - #32851

Merged
LekoArts merged 2 commits into
gatsbyjs:masterfrom
lovell:plugin-sharp-v0.29.0
Aug 20, 2021
Merged

LekoArts merged 2 commits into
gatsbyjs:masterfrom
lovell:plugin-sharp-v0.29.0

Conversation

@lovell

@lovell lovell commented Aug 19, 2021

Copy link
Copy Markdown
Contributor

Description

Related Issues

Fixes #31792

- Upgrade sharp to v0.29.0
- Replace use of imagemin with sharp equivalents
- Reduces JPEG, PNG and AVIF encoding time by up to 50%
- Reduces install size/time by ~10% (~19MB smaller)
@gatsbot gatsbot Bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 19, 2021
@lovell

lovell commented Aug 19, 2021

Copy link
Copy Markdown
Contributor Author

The windows_unit_tests failure is, I suspect, due to the use of a (shared?) npm cache in CircleCI colliding with lovell/sharp#2848. If there's a way to manually clear this cache then it should work when re-run.

@LekoArts LekoArts added topic: media Related to gatsby-plugin-image, or general image/media processing topics and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Aug 19, 2021
@LekoArts

Copy link
Copy Markdown
Contributor

Removes GPLv3 code from the dependency graph

So this is in our plugin, not sharp itself?

@lovell

lovell commented Aug 19, 2021

Copy link
Copy Markdown
Contributor Author

So this is in our plugin, not sharp itself?

Yes, this PR removes the GPLv3 pngquant-bin dependency from Gatsby via the removal of imagemin-pngquant. sharp has never shipped GPL code, and now provides the same features via the BSD-2-Clause https://github.com/lovell/libimagequant

@pieh

pieh commented Aug 19, 2021

Copy link
Copy Markdown
Contributor

The windows_unit_tests failure is, I suspect, due to the use of a (shared?) npm cache in CircleCI colliding with lovell/sharp#2848. If there's a way to manually clear this cache then it should work when re-run.

I checked syncinc version of sharp used in all packages and that seemed to the trick ( #32852 temporary PR that runs those tests with my small change). I opened PR with this change against your branch in lovell#1 (tho I didn't yet check wether there are any breaking changes in 0.29 those other packages might need to address)

@LekoArts LekoArts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! We'll merge and publish under next tag and before the 3.13 release check is everything works :) Thanks for your work!

@LekoArts
LekoArts merged commit ddcfbd8 into gatsbyjs:master Aug 20, 2021
@lovell
lovell deleted the plugin-sharp-v0.29.0 branch August 20, 2021 15:01
raffishquartan pushed a commit to raffishquartan/gatsby that referenced this pull request Apr 28, 2026
…sbyjs#32851)

* feat(gatsby-plugin-sharp): reduce encoding time and install size

- Upgrade sharp to v0.29.0
- Replace use of imagemin with sharp equivalents
- Reduces JPEG, PNG and AVIF encoding time by up to 50%
- Reduces install size/time by ~10% (~19MB smaller)

* sync sharp version in all packages (gatsbyjs#1)

Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: media Related to gatsby-plugin-image, or general image/media processing topics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[gatsby-plugin-image, sharp] Black border is added directly to an image

3 participants