Browse Source

fix favicon.hi with 57x57 ahoy logo, gzip yielded no benefits #b78437b

pull/107/head
stefan123t 3 years ago
parent
commit
b6ebf1bb5b
  1. BIN
      tools/esp8266/html/ahoy_logo_57x57.png
  2. 121
      tools/esp8266/html/h/favicon.h
  3. 8
      tools/esp8266/html/hexlify.py
  4. 11
      tools/esp8266/main.cpp
  5. 9
      tools/esp8266/platformio.ini

BIN
tools/esp8266/html/ahoy_logo_57x57.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

121
tools/esp8266/html/h/favicon.h

@ -0,0 +1,121 @@
//-----------------------------------------------------------------------------
// 2022 Ahoy, https://www.mikrocontroller.net/topic/525778
// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
//-----------------------------------------------------------------------------
// a) https://www.favicon-generator.org/
// b) exiftool -all:all= -r ahoy_logo_*
// c) ./hexlify.py ahoy_logo_57x57.png >> h/favicon.h
#define FAVICON_PANEL_57 \
"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52" \
"\x00\x00\x00\x39\x00\x00\x00\x39\x08\x00\x00\x00\x00\xa9\x73\xdc" \
"\x59\x00\x00\x00\x20\x63\x48\x52\x4d\x00\x00\x7a\x26\x00\x00\x80" \
"\x84\x00\x00\xfa\x00\x00\x00\x80\xe8\x00\x00\x75\x30\x00\x00\xea" \
"\x60\x00\x00\x3a\x98\x00\x00\x17\x70\x9c\xba\x51\x3c\x00\x00\x00" \
"\x02\x62\x4b\x47\x44\x00\x00\xaa\x8d\x23\x32\x00\x00\x06\x61\x49" \
"\x44\x41\x54\x48\xc7\xd5\x96\x09\x50\x13\x57\x18\x80\x53\x71\x6a" \
"\xa7\xe3\x51\xec\xe8\x54\x9d\xd6\x63\x6a\x6b\x6d\xc7\xd6\xa9\xa3" \
"\x1d\xb5\xea\x68\xab\xd6\xa3\xd6\xab\x58\x54\x10\x50\x0e\xa5\xa1" \
"\x4a\x08\x97\xe1\xf0\xe0\x3e\x04\xcb\x25\x84\x53\x20\xa2\x82\x12" \
"\xe4\x46\x54\x10\x45\x83\xe1\x0e\xd9\x08\x28\x60\x08\x08\x04\x08" \
"\x39\x48\xb2\xfb\x77\x77\x23\x64\x83\x60\x9d\xce\x74\xa6\x7d\xb3" \
"\xf3\xee\x6f\xdf\xff\xde\xff\xff\xef\xfd\x34\xf8\xa7\x89\xf6\x3f" \
"\x27\xb1\x97\x02\x04\xa9\x6c\x42\x04\x42\x99\x06\x7b\x7b\x12\xeb" \
"\xbc\xee\xe1\xb2\xe3\xd3\x80\x2c\x6e\xb6\xaf\xcb\x8d\x4c\x36\xb7" \
"\x44\x3c\x80\xbd\x05\x29\x2b\xf5\xb7\xdd\x9e\xfa\x22\x74\x52\x0c" \
"\xde\x50\x2b\x15\x3d\x8d\x25\xf1\x49\x01\xf1\x3c\xd9\xdf\x90\xdd" \
"\xd9\xd6\x76\xb1\x27\xe7\x85\xc1\x9d\x0f\x6c\xb4\xa3\xbd\x68\x57" \
"\xd1\xa5\x80\xa2\xce\x37\x91\x52\xdb\x53\x5c\x19\x7a\x80\xf6\x79" \
"\x8d\x74\xed\x4a\x09\x75\x0e\xda\x7a\x78\x47\x6a\x1b\x3a\x21\xa9" \
"\x60\x96\x01\x68\x4d\x8c\x67\x58\x2a\x8e\x4f\x0d\xe0\x14\x0f\x6a" \
"\x90\x1a\x44\x4d\x0e\xe5\x1a\x6f\xe1\xc6\x67\x23\xd8\x04\x24\xe4" \
"\x05\xa3\xa0\xdd\xbf\x7a\xe7\x27\xcd\xf1\x93\x8d\xde\x9f\x1a\x9a" \
"\xb2\x74\xc9\xd2\xb2\xc6\x7c\x35\xf4\x6c\x9f\x91\x0f\x5a\xce\x31" \
"\xe5\x44\x64\x3f\x43\x80\xaf\x39\x65\xa6\x51\x48\x99\xf1\xe6\xe8" \
"\xb9\xeb\x97\x99\x57\xed\xb1\xb3\xd8\xfa\xa0\x2d\xcc\x68\xd7\x20" \
"\xa8\x3d\x52\x27\x3e\xdb\xc8\x60\x0c\x35\x79\xf7\xe4\x92\x6f\x8b" \
"\xe6\xb1\x9a\x17\x6f\x58\x6e\xd3\xbc\x6b\xe7\xaa\x39\x4b\x9c\x96" \
"\x4f\xbf\x05\x70\xd3\x65\x68\x62\x12\x39\x2c\xc1\x4c\xa6\xf3\xec" \
"\x27\x7b\x6c\xdc\xfb\xf0\x23\xdb\xe4\xef\x97\xaf\x74\x33\x9e\x66" \
"\x13\x3f\xf7\xc7\x7e\xa8\x3f\x7a\x1f\x9d\x98\xac\x58\x7b\x7d\x60" \
"\xa3\x31\xbf\x90\xf1\x44\xc0\x1f\xb8\xd7\x8e\xb5\x17\x25\x6d\x98" \
"\x7f\xa9\xf9\xd2\x9f\x05\x30\xe0\x64\x66\xe9\x5f\xaf\x19\x9f\x1c" \
"\x4e\xf0\x8e\x64\x76\x45\x5d\x93\xaa\x9f\xb5\xde\xbd\x9a\x71\xad" \
"\xa4\xe5\xb9\xfc\xf4\xfa\x07\x58\x14\x8d\x0e\x18\x27\x68\x48\x74" \
"\xf5\x84\x8f\x64\x3c\x12\xcd\x09\xec\xe8\x3a\x22\xec\x2a\x8c\xf6" \
"\x74\xf0\x65\x87\x87\x87\xb3\x33\x3c\x63\x83\xb9\x7d\x68\xfe\xcf" \
"\x29\x70\xdb\x9f\x30\x23\xb1\xdb\xee\xfa\x71\x48\x9e\x8f\x1c\xb0" \
"\x90\x8b\x3e\xbf\x44\xf2\xfa\x74\xc7\x8f\xc9\x25\xe5\xec\x90\x94" \
"\xb4\x2a\x65\xbb\x67\x23\xd9\x33\x10\x62\x56\xff\x1a\x29\xf5\xa8" \
"\xc1\x73\x89\xdd\x17\xd1\x86\xe7\x20\x6f\xcd\x0c\xf3\xb5\xbe\x39" \
"\x22\x58\xdc\xc1\xca\xfe\x31\x64\x56\x04\x69\x21\x49\x5f\x23\xaf" \
"\x19\xa8\xba\xb6\x58\x3d\x52\xd7\x78\xcd\xda\x5a\x65\x40\xf6\xb8" \
"\x3e\x25\xcb\xde\x2a\xcd\x58\x10\x43\x31\x18\x12\x34\x48\x74\x4a" \
"\xf1\xa3\xd1\x36\x76\x52\x49\x8e\x4e\x48\x95\xa4\x7f\x8c\x37\x2a" \
"\xca\xe2\x58\xee\xee\xae\x8e\x47\x7f\x65\x44\x3c\x47\x01\x73\xa6" \
"\xd1\x8c\x7c\x29\xe4\x80\xab\x88\x28\xc4\x6c\x37\x46\x26\x45\xe1" \
"\x68\x43\xa2\xfb\x29\x36\x8f\xcf\x6f\x52\xf4\xd7\xe7\x05\x9d\xf6" \
"\x41\x20\x6f\x1a\x6d\xb6\x8d\x46\x4f\x8a\x82\x89\x86\x86\x5d\xa1" \
"\xaa\x31\x15\xe9\x28\x25\x6e\xfe\x19\x0c\x76\xb5\x4a\xff\xa3\x9e" \
"\x4b\x66\xf9\xd2\x7d\x8b\x3c\x19\x6d\x7a\x32\x8d\x4d\xe4\xfc\x18" \
"\x9c\xbf\x72\xb1\x0b\x5f\x15\x6b\x4c\x57\x62\xe9\x76\xed\xc4\xc2" \
"\x2a\x95\x4a\xa1\x54\x2a\x55\x2a\xb5\x34\x6d\x73\xf1\xd3\x9a\x82" \
"\xe6\xa1\x51\x12\xf5\x7a\x48\x14\xd9\xc5\xd0\x8b\x3e\xb1\x77\x2a" \
"\x01\x6d\x7e\x30\x02\x08\x5d\x04\xea\xfa\xbb\x37\x4e\x99\x5b\x9e" \
"\x67\x3a\x32\xec\xcc\xcc\x2e\xb0\x4c\x6d\x46\x65\x20\xc9\x0e\x06" \
"\x61\x56\x9a\x80\x6a\xe5\x39\x61\x62\x53\x5d\xb8\x3c\x3b\x16\xd7" \
"\x5a\x56\x1e\xc0\x9d\xc8\x5a\x81\xcf\xa6\x45\xb1\x82\x3a\x9e\x0d" \
"\x7d\x4d\xb0\x6a\xd0\xa5\xd2\x80\xac\xf3\x22\x14\xa6\xba\xdc\xaf" \
"\x49\xc0\xe5\x7e\x14\x9d\x14\x8d\x1b\x1b\xea\xce\xc3\xed\xb5\x0e" \
"\xd4\x0e\xab\x17\xa4\x00\x74\x39\x1e\xf2\x0d\xd1\x02\xd7\x55\x4d" \
"\x25\xaf\x92\xdb\x54\x25\xf7\xc1\x60\x52\x2d\x16\xc6\x6f\x69\x1b" \
"\xc4\x70\xb2\x02\x86\x18\xcd\x80\x55\xae\xd8\xd7\x87\xef\xbc\x76" \
"\xb5\x95\x00\xa0\xdd\xea\x39\x95\x64\xc7\x91\x2a\x67\xf3\x60\x38" \
"\x4d\xde\xe1\x2b\x7b\x11\xe7\x1d\x77\x41\x74\x33\x02\xea\xf6\xb6" \
"\x00\x70\x57\xf2\x89\xe1\x9c\x2f\xcb\x89\xc2\xbf\x84\x4a\x26\x73" \
"\xc8\x7a\x25\x07\x53\x47\x74\x29\xce\x3d\x05\x85\xb8\xaa\xa0\xab" \
"\xd3\xa6\x92\xbe\x30\x92\x9d\xe0\xc8\xbc\x7b\x33\x87\x93\x68\xbd" \
"\x25\xfa\x56\x43\x83\x30\x3c\xd0\x40\x5a\xdd\x7f\x14\x91\x08\x44" \
"\x06\xb4\x9c\xad\xad\x2d\x1c\x26\x64\xe0\xee\x99\x35\xe3\xb3\xf9" \
"\x0b\xb7\x1d\x32\x5d\xb7\xe9\x9b\x05\xf3\x17\xcc\xff\x6a\xdd\xd2" \
"\x8f\x3f\xb4\xd5\x52\xc8\xc4\xcb\xba\x86\xe0\xf4\xd9\xc0\x90\x03" \
"\x67\x94\x62\x16\x87\x44\x1f\x2c\xde\x8d\x88\x44\x22\xa1\x50\x84" \
"\x10\xa5\x08\x11\x66\x04\x5a\x78\x53\xd7\xbc\x96\xac\x6b\x74\x58" \
"\xe4\x88\x31\x9f\x1c\x80\xa1\x54\x0e\xe1\xa3\x58\xd4\x71\xfc\xa4" \
"\x5a\x86\xe1\xa5\xde\x0f\x72\xfc\xa9\x64\x63\x3a\x59\xd7\xb2\x56" \
"\xe0\x7a\xe5\x26\x11\xe7\x9c\x14\x4b\x4c\x7e\xec\x8c\x82\xdc\xad" \
"\x13\x62\x9f\x8f\x92\x91\x67\xa9\x24\xe2\x41\xde\x02\xa5\xbb\x57" \
"\xe3\xe4\xed\x04\x72\xcf\x3c\xc5\x2b\x52\xe1\x2a\x86\x73\xd5\xa3" \
"\x4e\xc0\xcc\xa2\x92\x0a\x3f\xfc\xf0\x41\x4e\xb7\x58\x89\xfb\x75" \
"\x58\xae\xde\xc6\x1f\xbb\xa0\x80\xde\x93\x42\x79\xfb\x48\x4f\x83" \
"\xf9\x0b\x2a\x09\x31\x99\x78\x56\x7b\xea\xf7\x6d\x0e\xa5\x65\xb6" \
"\x65\x7a\x92\x1f\x85\xbb\x2b\xf9\xc9\x74\x2c\x16\x7a\xd1\xc0\xfa" \
"\xa0\xd9\x4f\x09\xe8\xd9\x2b\x67\xf2\xeb\x12\xd9\x7c\xb5\x9e\xe4" \
"\xb1\xd0\x16\xdd\xbd\x93\x9a\x46\x16\xe5\xe6\x62\x43\x72\xf8\xfc" \
"\x3d\x50\x9c\x6c\xf0\x2e\x05\xc3\xf4\x98\x09\x85\x69\xf8\x86\x65" \
"\x05\x27\x48\x9f\x44\x4c\xd2\xc1\x90\x84\x02\x87\xe1\xa7\xae\x03" \
"\x5e\x63\xc9\xaa\x73\x98\x22\x3b\x2e\x36\x94\x19\x54\x47\xc8\x5c" \
"\x6a\xc6\xd1\x8e\x25\xfb\xe8\xd5\xb9\x4e\xa8\xa7\x8e\x94\x8d\xbe" \
"\x3d\x82\x0a\x7c\xbe\xb8\xe8\x7a\x23\xb9\x83\xa6\xed\xc9\x94\xab" \
"\x66\xe4\xd6\x2c\xdc\x65\xcd\x52\x79\x90\x24\x1a\xb4\xc3\xab\xa8" \
"\x9b\xec\xad\xe1\xeb\x67\x62\x8d\xc7\x28\x2b\xea\x49\xc5\xe1\xf3" \
"\x5e\xcf\x52\x52\x88\xea\xe0\x1a\xda\xa4\x29\xa6\xcd\xd2\x3e\x69" \
"\xb7\x63\xb1\x1e\xcc\xfa\x29\x9d\x0a\xea\x5f\x87\x7a\x4b\xba\xea" \
"\xbe\x1f\x51\x53\x86\x6e\x5e\xb1\x62\x95\xb9\xbd\xbd\xfd\xa6\xd9" \
"\x05\x23\xc3\xf2\x74\x93\x4c\x03\x90\xf2\x96\x71\x4d\x24\xf9\x7b" \
"\xa5\xc4\x9e\x4b\x83\x03\x8b\x5a\x3b\x3a\x84\x25\xfb\xdf\x2b\x7c" \
"\x35\x28\xfc\xe3\xb7\x7a\x80\x09\xc8\xe1\xe8\xa3\x56\xd6\xc4\xcd" \
"\x9f\x30\xf3\x1d\xa3\x39\x16\x1e\x2c\xfa\x89\x03\x33\x75\x6b\x0e" \
"\x5e\xde\xe2\xfc\x12\x26\x24\x61\xd8\xff\x3b\xaf\x30\x5c\xa2\x56" \
"\xa7\x55\xab\x4c\xaf\x56\xf3\xeb\x06\x7a\x1d\x43\x08\xee\x01\xfd" \
"\xe0\x8d\x21\x78\x03\x09\xf2\xc7\x6e\x6b\xcf\x54\xcb\x01\xed\xed" \
"\x7d\xe5\x55\x8f\x98\xe8\x60\xd6\x91\x7d\xf1\xe3\x05\x61\x86\x71" \
"\x9f\xaa\x21\xc6\x95\xc5\xed\x1e\xd5\x5a\x81\x49\xc4\x41\xab\x5c" \
"\xc9\xb8\x91\xdf\x6b\xb1\xa6\xa2\x26\x98\xe9\x97\xfa\x84\x5f\x5d" \
"\x5b\xc3\x4b\xd8\xb3\x9c\x99\xd5\x0b\xe3\xa7\x71\xe2\x5b\xb4\xbb" \
"\xd0\xd7\x8d\x65\xba\xec\x07\x67\xdf\x0c\x44\x0b\xf0\xf6\x24\x9e" \
"\x30\x2d\xda\x23\x68\x7b\x63\x78\xfb\x1f\x89\xc6\xff\x7d\xf2\x2f" \
"\x5f\x86\xf8\x6e\x11\xdc\xcf\x5c\x00\x00\x00\x00\x49\x45\x4e\x44" \
"\xae\x42\x60\x82"

8
tools/esp8266/html/hexlify.py

@ -0,0 +1,8 @@
#!/usr/bin/python
import sys
f = open (sys.argv[1], 'rb').read()
for n, c in enumerate(f):
if n % 16 == 0: print (' "', end = '')
print (f"\\x{c:02x}", end = '')
if n % 16 == 15: print ('" \\')
if n % 16 != 15: print ('"')

11
tools/esp8266/main.cpp

@ -8,7 +8,7 @@
#include "html/h/style_css.h"
#include "html/h/setup_html.h"
#include "html/h/favicon_ico_gz.h"
#include "html/h/favicon.h"
//-----------------------------------------------------------------------------
@ -264,9 +264,12 @@ void Main::showCss(AsyncWebServerRequest *request) {
//-----------------------------------------------------------------------------
void Main::showFavicon(AsyncWebServerRequest *request) {
DPRINTLN(DBG_VERBOSE, F("Main::showFavicon"));
AsyncWebServerResponse *response = request->beginResponse_P(200, F("image/x-icon"), favicon_ico_gz, favicon_ico_gz_len);
response->addHeader(F("Content-Encoding"), "gzip");
DPRINTLN(DBG_VERBOSE, F("app::showFavicon"));
static const char favicon_type[] PROGMEM = "image/x-icon";
static const unsigned char favicon_content[] PROGMEM = FAVICON_PANEL_57;
// mWeb->send_P(200, favicon_type, favicon_content, sizeof(favicon_content));
AsyncWebServerResponse *response = request->beginResponse_P(200, favicon_type, favicon_content, sizeof(favicon_content));
// response->addHeader(F("Content-Encoding"), "gzip");
request->send(response);
}

9
tools/esp8266/platformio.ini

@ -13,7 +13,8 @@ build_flags = -Wl,-Teagle.flash.1m64.ld
lib_deps =
nrf24/RF24@1.4.2
PubSubClient
Time
ArduinoJson
ESP Async WebServer
paulstoffregen/Time@^1.6.1
knolleary/PubSubClient@^2.8
bblanchon/ArduinoJson@^6.19.4
me-no-dev/ESP Async WebServer@^1.2.3
me-no-dev/ESPAsyncTCP@^1.2.2

Loading…
Cancel
Save