Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By mrburnette
#63232 I have an example for the favorite icon here:
https://www.hackster.io/rayburne/nodemcu-esp8266-remote-temperature-using-websockets-5956c4?team=22106

This will show a small icon of Einstein.

My image example is here:
https://www.hackster.io/rayburne/esp8266-01-web-server-696587

This allows you to store the image directly in SPIFFS as a file. With files, one can manipulate based on the 3 character suffix, something like this:
Code: Select allString getContentType(String filename) {
  yield();
  if (server.hasArg("download"))      return "application/octet-stream";
  else if (filename.endsWith(".htm")) return "text/html";
  else if (filename.endsWith(".html"))return "text/html";
  else if (filename.endsWith(".css")) return "text/css";
  else if (filename.endsWith(".js"))  return "application/javascript";
  else if (filename.endsWith(".png")) return "image/png";
  else if (filename.endsWith(".gif")) return "image/gif";
  else if (filename.endsWith(".jpg")) return "image/jpeg";
  else if (filename.endsWith(".ico")) return "image/x-icon";
  else if (filename.endsWith(".xml")) return "text/xml";
  else if (filename.endsWith(".pdf")) return "application/x-pdf";
  else if (filename.endsWith(".zip")) return "application/x-zip";
  else if (filename.endsWith(".gz"))  return "application/x-gzip";
  else if (filename.endsWith(".svg")) return "image/svg+xml";
  return "text/plain";
}


Anyway, download the code and study the examples. More here: https://www.hackster.io/rayburne/projects