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

feat: option to convert png to webp #24

Conversation

Christopher-Hayes
Copy link
Contributor

Feature

  • Adds a config option to convert PNGs to WebPs
  • Uses the cwebp-bin JS wrapper to run Google's cwebp PNG->WebP convert tool
  • This config option is by default turned off

Notes

The implementation in the image-compressor.ts is not the most elegant. If converting from one file format to another format or having different tools to convert one format becomes a more common thing with this application, it could probably use a more maintainable approach than the one I used for webp.

I did not use the latest version of cwebp-bin, this is because I was running into this issue documented here. The latest version that works without that bug is v6.1.2.

I'm not partial to any choices I made on this feature, by all means make edits to this feature that are more in line with this application as a whole.

closes #23

@Christopher-Hayes Christopher-Hayes changed the title Feature/add png to webp option [Feature] Add Convert PNG->WebP Setting May 26, 2022
@Christopher-Hayes Christopher-Hayes changed the title [Feature] Add Convert PNG->WebP Setting feat: option to convert png to webp May 26, 2022
@antonreshetov
Copy link
Owner

@Christopher-Hayes Thanks for the PR. I also added the ability to convert JPG to WebP.

@antonreshetov antonreshetov merged commit 37caeed into antonreshetov:master Jun 6, 2022
@Christopher-Hayes
Copy link
Contributor Author

Awesome, thanks!

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.

[Feature Request] WebP Support
2 participants