GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(gatsby-plugin-sharp): reduce encoding time and install size by lovell · Pull Request #32851 · gatsbyjs/gatsby

Conversation

@lovell

@lovell lovell commented Aug 19, 2021

Copy link
Copy Markdown
Contributor

Description

  • Upgrades sharp to v0.29.0
  • Replaces use of imagemin with sharp equivalents
  • Removes GPLv3 code from the dependency graph
  • Reduces JPEG, PNG and AVIF encoding time by up to 50%
  • Reduces total Gatsby install size/time by ~10% (~19MB smaller on the filesystem)
  • Improves AVIF image quality, will allow them to work with Chrome 93+
    AVIF files produces are invalid and not displayed by recent Chrome Canary lovell/sharp#2666

Related Issues

Fixes #31792

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

LekoArts, DSchau, ascorbic, KyleAMathews, t2ca, and Hahlh reacted with hooray emoji Hahlh and balazsorban44 reacted with heart emoji
All reactions
  • 🎉 6 reactions
  • ❤️ 2 reactions
@lovell
feat(gatsby-plugin-sharp): reduce encoding time and install size
e5a8602
- 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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

LekoArts commented Aug 19, 2021

Copy link
Copy Markdown
Contributor

Removes GPLv3 code from the dependency graph

So this is in our plugin, not sharp itself?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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

LekoArts reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Aug 19, 2021
[do-not-merge] checking 32851 #32852
Closed
sync sharp version in all packages lovell/gatsby#1
Merged
@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)

lovell reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pieh
sync sharp version in all packages (#1)
558dd77
LekoArts
LekoArts approved these changes Aug 20, 2021
View reviewed changes

@LekoArts LekoArts left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lovell reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@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
@lovell @pieh
feat(gatsby-plugin-sharp): reduce encoding time and install size (gat…
e8aef01
…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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@LekoArts LekoArts LekoArts approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@lovell @LekoArts @pieh
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402605 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.