Comments on: How to Display Images in ESP32 and ESP8266 Web Server https://randomnerdtutorials.com/display-images-esp32-esp8266-web-server/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Mon, 17 Mar 2025 12:31:53 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Sara Santos https://randomnerdtutorials.com/display-images-esp32-esp8266-web-server/#comment-933223 Tue, 02 Jul 2024 09:31:04 +0000 https://randomnerdtutorials.com/?p=86386#comment-933223 In reply to GaryD.

Hi.
We have this web server project, in which we set an image as a background. You can take a look and see if you can adapt it.
https://randomnerdtutorials.com/esp32-lora-sensor-web-server/
Regards,
Sara

]]>
By: GaryD https://randomnerdtutorials.com/display-images-esp32-esp8266-web-server/#comment-932921 Mon, 01 Jul 2024 21:45:08 +0000 https://randomnerdtutorials.com/?p=86386#comment-932921 Sara:
Trying to load a stored image in little FS and set the image as the HTML backround. Tried numerous HTML code and cant get it to display as WebServer backround. Can you provide a code snippet?

]]>
By: Steve Spence https://randomnerdtutorials.com/display-images-esp32-esp8266-web-server/#comment-908722 Mon, 22 Apr 2024 13:46:11 +0000 https://randomnerdtutorials.com/?p=86386#comment-908722 Tools > ESP32 Data Sketch Upload not supported in IDE 2.x
How else can I load a gif into my esp32 for my webserver code to display?

]]>
By: Ed https://randomnerdtutorials.com/display-images-esp32-esp8266-web-server/#comment-890881 Tue, 13 Feb 2024 20:38:54 +0000 https://randomnerdtutorials.com/?p=86386#comment-890881 In reply to noel cris.

Either by giving your html a link to a remote faviconm or if you want your own favicon stored in LittleFS:

<link rel=”icon” type=”image/x-icon” href=’/favicon.png’>
with
server.on(“/favicon.png”, HTTP_GET, [](AsyncWebServerRequest *request){
request->send(LittleFS, “/favicon.png”, “image/png”);
});

]]>
By: John N https://randomnerdtutorials.com/display-images-esp32-esp8266-web-server/#comment-885379 Sun, 21 Jan 2024 17:28:25 +0000 https://randomnerdtutorials.com/?p=86386#comment-885379 See comments in this thread: https://randomnerdtutorials.com/install-esp8266-nodemcu-littlefs-arduino/#comment-885378

]]>
By: John https://randomnerdtutorials.com/display-images-esp32-esp8266-web-server/#comment-884819 Thu, 18 Jan 2024 19:20:16 +0000 https://randomnerdtutorials.com/?p=86386#comment-884819 After creating a remote sensor/webserver for my wifes greenhouse, I wanted to do some upgrades. Since that time SPIFFS has been deprecated, and LittleFS is not supported in the 2.XX versions of Arduino IDE. So I then turned to VScode/PlatformIO for the IDE only to find there were not libraries for the ESP8266 version of LittleFS. I really don’t want to get into Base64 code. Where does that leave me, other than rolling back to an earlier version of the Arduino IDE?

]]>
By: Ed https://randomnerdtutorials.com/display-images-esp32-esp8266-web-server/#comment-884768 Thu, 18 Jan 2024 14:07:43 +0000 https://randomnerdtutorials.com/?p=86386#comment-884768 I do not us the base64 method often as it makes the programs a bit complicated to read, but as I just now quickly needed to insert a picture in a ‘remote’ ESP through OTA, it was quickest to use base64, so I came back to this tutorial, inserted my pic and got all sorts of unexplainable compilation errors.
Long story short: It got solved by using single quotes (‘) rather than double quotes (“) around the base64 code.

]]>
By: luis https://randomnerdtutorials.com/display-images-esp32-esp8266-web-server/#comment-838811 Mon, 05 Jun 2023 08:59:36 +0000 https://randomnerdtutorials.com/?p=86386#comment-838811 In reply to StanislavS.

Dear StanislavS:
I had same problem time ago please use a short path to your files
server.on(pic.c_str(), HTTP_GET, [](AsyncWebServerRequest *request){
request->send(SPIFFS, pic_.c_str(), “image/png”

]]>
By: StanislavS https://randomnerdtutorials.com/display-images-esp32-esp8266-web-server/#comment-838662 Sat, 03 Jun 2023 23:40:19 +0000 https://randomnerdtutorials.com/?p=86386#comment-838662 Hi Sara,
thank you for your answer.
I’ve tried:
String pic = “/sun”;
String pic_ = “/sun.png”;
server.on(pic.c_str(), HTTP_GET, [](AsyncWebServerRequest *request){
request->send(SPIFFS, pic_.c_str(), “image/png”);
});

And arduino ide say me:
C:\Users\stass\AppData\Local\Temp.arduinoIDE-unsaved202353-16856-f2m8gn.71yo\sketch_jun3a\sketch_jun3a.ino: In lambda function:
C:\Users\stass\AppData\Local\Temp.arduinoIDE-unsaved202353-16856-f2m8gn.71yo\sketch_jun3a\sketch_jun3a.ino:70:27: error: ‘pic_’ is not captured
request->send(SPIFFS, pic_.c_str(), “image/png”);
^~~~
C:\Users\stass\AppData\Local\Temp.arduinoIDE-unsaved202353-16856-f2m8gn.71yo\sketch_jun3a\sketch_jun3a.ino:69:37: note: the lambda has no capture-default
server.on(pic.c_str(), HTTP_GET, [](AsyncWebServerRequest *request){
^
C:\Users\stass\AppData\Local\Temp.arduinoIDE-unsaved202353-16856-f2m8gn.71yo\sketch_jun3a\sketch_jun3a.ino:68:10: note: ‘String pic_’ declared here
String pic_ = “/sun.png”;
^~~~

exit status 1

Compilation error: ‘pic_’ is not captured

But issue can be solved if use [=] instead [] in lambda.
Can someone come in handy.
Best Regards,
Stabislav

]]>
By: Sara Santos https://randomnerdtutorials.com/display-images-esp32-esp8266-web-server/#comment-838091 Tue, 30 May 2023 21:20:31 +0000 https://randomnerdtutorials.com/?p=86386#comment-838091 In reply to StanislavS.

Yes.
You can use string variables instead.
Regards,
Sara

]]>