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

Add image compression in automation #47

Open
TamimiGitHub opened this issue Jun 24, 2020 · 2 comments
Open

Add image compression in automation #47

TamimiGitHub opened this issue Jun 24, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@TamimiGitHub
Copy link
Member

TamimiGitHub commented Jun 24, 2020

in the ./export.sh script, include a step to iterate over all the assets in the img dir and compress all the images
For example
https://www.npmjs.com/package/compress-images

Notes:

  1. Once an npm package is installed, the cli executable can be accessed from node_modules/<name_of_package>/bin
  2. Rename compressed images to -compress. (or similar) to avoid recompressing already compressed images
  3. Add exception handling to image extensions that is not supported by the compression cli tool. There are alot of weird extensions for images
@Mrc0113
Copy link
Collaborator

Mrc0113 commented Jun 25, 2020

two thoughts:

  1. If you rename the files to add -compress on the end you also need to rename them in the markdown as well
  2. Before actually implementing this it would be good to do a quick comparison of a compressed png or jpeg vs. conversion to webp to see if there is a large different

@TamimiGitHub
Copy link
Member Author

TamimiGitHub commented Jun 25, 2020

Ah good point.

  1. We can mitigate the file rename with an update of the metadata of the file to add a compressed=true flag, or something along the lines
  2. Benchmarking is a good idea 👍 thanks

@Mrc0113 Mrc0113 added the enhancement New feature or request label Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants