Compress images with Zopfli/oxipng#531
Conversation
|
I'm struggling to see the idea. Sure, smaller file size is nice, but does that mean that every single contribution henceforth should be held to the standard of compressing images? I'm don't see the motivation for this initiative or the problem that this solves. By modern standards, 8 megabytes is very small, especially on a platform where you have up to 100 megabytes per file. Obviously saving data is saving data, and if it makes sense it should be merged, but I don't know if the effort is very necessary moving forward. Is there any specific reason for it I haven't considered? I apologize if I'm missing something. |
|
It might make more sense to run this as a Github action, for an automated slight-benefit, rather than running it manually for every image. |
Maybe, maybe not. It is a bit time consuming to run locally (Zopfli trades off a lot of time for space) but some sort of automation (likely via GitHub Actions like you mentioned) could make that easier. As for motivation, I just like saving space :). Primarily, the reason is to save space in the WPILib installer, which is already a monstrous 2+ GB blob. I recognize that the amount is small (especially compared to the installer), and so I know rejection is always a possibility (especially because it does bloat repo size), but after doing this to both Elastic and frc-docs, I have saved close to 30 MB across those two repos, and this will get me to ~40 MB. It legitimately does start adding up... but it is easy to undo. I think just upgrading Electron to the latest version will set back all the gains here. It's a much better idea to compress before committing to the main repo though (for repo size reasons), but this is as good as we can get. |
|
I hadn't considered the size of the WPILib installer. Thanks for clarifying that makes a little bit more sense although it's small :) |
Unnecessary metadata was also stripped with
--strip safe. Images in thewhats-newfolder were skipped on the premise that these will be removed later. In total, 8,092,487 bytes were saved. (Had I compressed thewhats-newfolder, that would've been 9,687,022 bytes... important to run oxipng before you push commits up! Maybe a pre-commit hook?)