Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic image optimization #6350

Closed
wants to merge 3 commits into from
Closed

Conversation

alb
Copy link

@alb alb commented May 21, 2021

Completed a TODO in the get-contributors.js file.
This pull request adds automatic optimization of the contributors.jpg image using reSmush.it. One can also fine tune the image optimization level using the quality variable. I chose 75 as the current value after some testing as at this level the image is reduced in size, however it still retains enough quality to not impact the final look of the contributors list.
Alternatively squoosh could also be used to optimize the image, however I was unsure whether it's allowed to add a new dependency to the project or not. If it is please let me know and I can change the PR to use Squoosh.

This PR also removes the GitHub API tokens in the file, as the API route to fetch the contributors list doesn't require authentication.

Before submitting the PR, please make sure you do the following

  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with npm test and lint the project with npm run lint

@benmccann benmccann added the site label May 29, 2021
Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

Approving, but someone who did this manually before should have a look, too

@benmccann
Copy link
Member

I wonder if it might be better to use something like vite-imagetools once we've migrated to SvelteKit

@alb
Copy link
Author

alb commented Jun 28, 2021

@benmccann that is probably a good idea since it would make it a lot simpler and more streamlined

@benmccann
Copy link
Member

We could also do it for all images then and without an external API call. Let's try that route then. I got the site mostly converted to SvelteKit last night #6468, so I'll go ahead and close this one. I'd love some help with getting vite-imagetools setup after I finish getting the site converted. Thanks again for taking a stab at this!

@benmccann benmccann closed this Jun 29, 2021
@alb alb deleted the get-contrib-improvements branch June 29, 2021 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants