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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add favicon on browser #14322

Merged
merged 8 commits into from
Jan 8, 2022
Merged

Add favicon on browser #14322

merged 8 commits into from
Jan 8, 2022

Conversation

barbudor
Copy link
Contributor

@barbudor barbudor commented Jan 7, 2022

Description:

Related issue (if applicable): fixes #4830

Add a favicon directly encoded in base64 in the HTML header (not served through the webserver)
May be not the most pretty tasmo'art but compact (16x16, 16 grey levels).
Only cost 256 bytes of flash due to unishox compression (馃檹 @s-hadinger )

Needed a small change in html compression tool to support string with // inside. => @s-hadinger
(replaced the split() with a simple state-machine parser)

@gemu2015 could you please check that I've not broken SCRIPT_FULL_WEBPAGE please ?

image

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.4.9
  • The code change is tested and works with Tasmota core ESP32 V.2.0.2
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@arendst
Copy link
Owner

arendst commented Jan 8, 2022

Thx. As the icon is actually black and white do you see a chance to lower it's color depth from 16 gray scale to 1 gray scale?

I don't use compression so for me it adds 400+ bytes bogus information.

@s-hadinger
Copy link
Collaborator

Awesome!

@s-hadinger
Copy link
Collaborator

Black and white would make it ugly since there would be no dithering.
What about a #ifdef?

@arendst
Copy link
Owner

arendst commented Jan 8, 2022

I love #ifdef.

@barbudor
Copy link
Contributor Author

barbudor commented Jan 8, 2022

Hi @arendst
Reduced to 1 bit which move the HTML cost from 488 down to 328 (-160 bytes)
No gain on compressed, still 256 bytes.
Aliaising is not as bad as I would have expected
image
Indeed the browser or windows is doing some dithering on its own
image

I added #ifdef USE_WEB_FAVICON
But because compressor script ignore preprocessing it will work only for uncompressed.
When using unishox, favicon will always be included.

@arendst
Copy link
Owner

arendst commented Jan 8, 2022

Thx. Will chk today

@arendst arendst merged commit 027eb98 into arendst:development Jan 8, 2022
@InHi66
Copy link
Contributor

InHi66 commented Jan 8, 2022

i do it this way:

in xdrv_01_webserver.ino

i add at "const char HTTP_HEAD_STYLE3[]"

following

</style>""" & vblf & " """"" & vblf & vblf

@barbudor barbudor deleted the favicon branch January 8, 2022 10:49
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

4 participants