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

Optimize assets for size #35

Merged
merged 3 commits into from
Sep 30, 2020
Merged

Optimize assets for size #35

merged 3 commits into from
Sep 30, 2020

Conversation

toofishes
Copy link
Contributor

I broke this into individual commits in case any of them are seen as undesirable.

For full disclosure- I will next try and implement OpenEVSE/ESP8266_WiFi_v2.x#160 in this repository, but wanted to ensure there was no concerns about asset bloat. By reducing the current assets in size by 8KB, I figured adding additional assets would be more acceptable.

Here are the two meaningful commits and descriptions:

Run optipng on favicon-32x32 to shrink size

The 16x16 favicon was already fully optimized, but the 32x32 image was
not. This saves 142 bytes, which isn't much, but very little reason not
to do so.

Run svgo SVG optimizer on wifi images

These XML files contain a bunch of inkscape metadata that is not needed
to render the image. Use the svgo utility (https://github.com/svg/svgo)
with default options to remove all unnecessary bits from the files,
saving roughly 8 KB across the five images.

Obviously it is possible I missed something, but I did a visual
verification that nothing changed in the rendering of these images. I
cannot test in every possible browser, however.
You can do the "rich diff" option in Github on this PR to view the old and new images side by side.

@toofishes toofishes changed the base branch from master to v3_gui September 29, 2020 21:56
For anyone developing on OS X, this should prevent checkins of this
auto-generated file on accident.
The 16x16 favicon was already fully optimized, but the 32x32 image was
not. This saves 142 bytes, which isn't much, but very little reason not
to do so.
These XML files contain a bunch of inkscape metadata that is not needed
to render the image. Use the svgo utility (https://github.com/svg/svgo)
with default options to remove all unnecessary bits from the files,
saving roughly 8 KB across the five images.

Obviously it is possible I missed something, but I did a visual
verification that nothing changed in the rendering of these images. I
cannot test in every possible browser, however.
@toofishes
Copy link
Contributor Author

I noticed in another PR you said to rebase to v3_gui, so I did the same here. Let me know if you need it changed to master or anywhere else and I can do that!

@glynhudson
Copy link
Contributor

Thanks 👍

@glynhudson glynhudson merged commit 8207ff6 into OpenEVSE:v3_gui Sep 30, 2020
@toofishes toofishes deleted the optimize-assets branch October 7, 2020 23:48
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.

None yet

2 participants