From f1b2f055334aee78ab02b531f0b237e6c9ae9d2c Mon Sep 17 00:00:00 2001 From: -cr <105788188+DE-cr@users.noreply.github.com> Date: Sat, 24 Aug 2024 22:06:48 +0200 Subject: [PATCH 1/2] favicon improvements 1. no more advertising favicon.svg as icon, so clients will ask for favicon.ico on their own 2. favicon.ico manually re-drawn for better legibility (and slightly smaller code size) 3. bug fix: favicon.ico was delivered to clients w/o its last byte (which lead Chromium based browser to not use/show it) Trigger for this change: when using a dark desktop theme, as I do, the black favicon.svg with its transparent background was hardly visible on a dark gray browser tab. Favicon,ico does have a white background, making the black BSBLAN visible on light and dark browser tabs. It is also much more readable than favicon.svg scaled down to 16x16 pixels by a browser. Change tested using - Firefox, Chrome, Chromium on Ubuntu - Safari, Chrome on MacOS - Edge on Win11 --- BSB_LAN/BSB_LAN.ino | 2 +- BSB_LAN/html_strings.h | 55 +++++++++++++++--------------------------- 2 files changed, 21 insertions(+), 36 deletions(-) diff --git a/BSB_LAN/BSB_LAN.ino b/BSB_LAN/BSB_LAN.ino index a1fd857f..5464f39d 100644 --- a/BSB_LAN/BSB_LAN.ino +++ b/BSB_LAN/BSB_LAN.ino @@ -5063,7 +5063,7 @@ void loop() { if (!strcmp(cLineBuffer, "/favicon.ico")) { printHTTPheader(HTTP_OK, MIME_TYPE_IMAGE_ICON, HTTP_DO_NOT_ADD_CHARSET_TO_HEADER, HTTP_FILE_NOT_GZIPPED, HTTP_NO_DOWNLOAD, HTTP_AUTO_CACHE_AGE); printToWebClient("\r\n"); - printPStr(favicon, sizeof(favicon)); + printPStr(favicon, 1+sizeof(favicon)); flushToWebClient(); break; } diff --git a/BSB_LAN/html_strings.h b/BSB_LAN/html_strings.h index 9e2cc077..70c2e1be 100644 --- a/BSB_LAN/html_strings.h +++ b/BSB_LAN/html_strings.h @@ -18,40 +18,26 @@ const char svg_favicon[] = ""; const char favicon[] = { - 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, - 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F, 0xF3, 0xFF, - 0x61, 0x00, 0x00, 0x01, 0xDD, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8D, 0xA5, 0x91, 0x3D, 0x6B, 0x22, - 0x51, 0x14, 0x86, 0xAF, 0xC4, 0x60, 0xB0, 0x50, 0xA6, 0xF0, 0x23, 0xE0, 0x60, 0x0A, 0x09, 0x04, - 0x52, 0xDA, 0xDB, 0x68, 0xEA, 0xF9, 0x11, 0x23, 0xA4, 0xF1, 0x07, 0x58, 0x5B, 0x0A, 0x16, 0x16, - 0x0E, 0x36, 0x26, 0x69, 0x75, 0xBA, 0xA0, 0x85, 0x36, 0x62, 0x27, 0x29, 0x45, 0xC1, 0x0F, 0x10, - 0x14, 0x8B, 0xC9, 0x80, 0x95, 0x82, 0x88, 0x73, 0x9F, 0x14, 0xB2, 0xC3, 0x4A, 0x66, 0xB3, 0x0B, - 0xFB, 0xC2, 0x29, 0xCE, 0xE1, 0xE1, 0xB9, 0x5C, 0x5E, 0xC1, 0x7F, 0x46, 0x00, 0x6C, 0x36, 0x1B, - 0x96, 0xCB, 0x25, 0xCB, 0xE5, 0x92, 0xFD, 0x7E, 0x0F, 0xC0, 0xE1, 0x70, 0x70, 0x6F, 0xAB, 0xD5, - 0x8A, 0x3F, 0x71, 0x62, 0xBB, 0xDD, 0x72, 0x75, 0x75, 0x85, 0xAA, 0xAA, 0xA8, 0xAA, 0x4A, 0x32, - 0x99, 0x64, 0xB7, 0xDB, 0x91, 0x4A, 0xA5, 0xDC, 0x5B, 0x3A, 0x9D, 0xC6, 0x8B, 0x73, 0x1C, 0x07, - 0xF1, 0xF9, 0xF9, 0x89, 0xA2, 0x28, 0x18, 0x86, 0x41, 0xB9, 0x5C, 0x46, 0x51, 0x14, 0xD6, 0xEB, - 0x35, 0x8A, 0xA2, 0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74, 0x3A, 0x08, 0x21, 0x30, 0x0C, 0x03, 0x80, 0x87, - 0x87, 0x07, 0x46, 0xA3, 0x91, 0xB7, 0x20, 0x97, 0xCB, 0x11, 0x0A, 0x85, 0x28, 0x95, 0x4A, 0x3C, - 0x3D, 0x3D, 0x21, 0x84, 0xA0, 0x5A, 0xAD, 0xF2, 0xF8, 0xF8, 0xC8, 0xDD, 0xDD, 0x1D, 0xAF, 0xAF, - 0xAF, 0xDF, 0x05, 0x8E, 0xE3, 0xB8, 0x53, 0x28, 0x14, 0xC8, 0x64, 0x32, 0x94, 0x4A, 0x25, 0x8A, - 0xC5, 0x22, 0x81, 0x40, 0x80, 0x66, 0xB3, 0x49, 0x36, 0x9B, 0x65, 0x3E, 0x9F, 0xA3, 0xAA, 0x2A, - 0xC1, 0x60, 0xF0, 0x2C, 0x58, 0xAD, 0x56, 0xF8, 0xFD, 0x7E, 0x84, 0x10, 0xEE, 0x9F, 0x2D, 0xCB, - 0xA2, 0x52, 0xA9, 0x00, 0x30, 0x99, 0x4C, 0x30, 0x0C, 0x83, 0x6E, 0xB7, 0x4B, 0x36, 0x9B, 0x05, - 0x60, 0x3C, 0x1E, 0x13, 0x8D, 0x46, 0x59, 0x2C, 0x16, 0xE7, 0x16, 0xA4, 0x94, 0x17, 0x03, 0xE0, - 0x38, 0x0E, 0x00, 0xA7, 0xD3, 0x89, 0xDF, 0x99, 0x5F, 0x39, 0x1E, 0x8F, 0x3F, 0xD7, 0xF8, 0xAF, - 0xF9, 0x02, 0x05, 0xC4, 0x09, 0xEE, 0x49, 0x43, 0x56, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, - 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82 + 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x10, 0x10, 0x10, 0x00, 0x01, 0x00, 0x04, 0x00, 0x28, 0x01, + 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x20, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x40, 0x42, 0x40, 0x00, 0x80, 0x83, 0x81, 0x00, 0x93, 0x96, 0x94, 0x00, 0xa7, 0xaa, + 0xa8, 0x00, 0xb0, 0xb3, 0xb1, 0x00, 0xbe, 0xc1, 0xbe, 0x00, 0xc3, 0xc7, 0xc4, 0x00, 0xcb, 0xcf, + 0xcc, 0x00, 0xd2, 0xd6, 0xd3, 0x00, 0xe2, 0xe5, 0xe3, 0x00, 0xea, 0xed, 0xeb, 0x00, 0xf0, 0xf4, + 0xf1, 0x00, 0xf4, 0xf8, 0xf5, 0x00, 0xf9, 0xfc, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0xee, + 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xb0, 0x00, + 0x0a, 0x0e, 0x0a, 0xc0, 0xed, 0x0d, 0xa0, 0xbc, 0xc4, 0x05, 0x02, 0xc0, 0xd7, 0x0d, 0xa0, 0xee, + 0xe3, 0x00, 0x01, 0xb0, 0x80, 0x0d, 0xa0, 0xee, 0xe4, 0x04, 0x03, 0xc0, 0x0e, 0x0c, 0xc0, 0xee, + 0xea, 0x00, 0x0a, 0xe0, 0xee, 0x0e, 0xee, 0xee, 0xee, 0x81, 0x8e, 0xee, 0xee, 0xee, 0xee, 0xee, + 0xee, 0xe7, 0xce, 0xee, 0xee, 0xee, 0xec, 0xbb, 0xce, 0xbb, 0xbd, 0xec, 0xbb, 0xce, 0xd0, 0x00, + 0x6b, 0x00, 0x05, 0xc0, 0x00, 0x6c, 0xd0, 0x99, 0x0c, 0xb9, 0x90, 0xb0, 0x99, 0x0c, 0xd0, 0x00, + 0x6d, 0x40, 0x0b, 0xd0, 0x00, 0x6e, 0xd0, 0x77, 0x0d, 0x07, 0x79, 0xd0, 0x77, 0x0e, 0xe0, 0x00, + 0xee, 0xe0, 0x00, 0xe0, 0x00, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; const char graph_html[] = @@ -426,7 +412,6 @@ const char header_html[] = "" NEWLINE "" NEWLINE "" NEWLINE - "" NEWLINE "BSB-LAN" NEWLINE "