I'm working on an embedded esp32 design using one of the webserver examples that is included in the esp-idf examples. I'm able to get device into soft AP mode and display a simple webpage. Now that I have that working, I'm trying to build a page with a graphic.
I'm using the linux hex tool "xxd -i " to convert the html file into a hex dump array for the C include file. It works fine if the document is just HTML, but I'm stuck on trying to include an image.
I went as far as using xxd on both the HTML file and the image file and using "netconn_write" to write out both files. I also tried combining them into a single hex dump file.
At this point I'm not sure how to proceed, am I taking the wrong approach with this?
Any help is greatly appreciated.
embedded images in html file with xxd ?
Re: embedded images in html file with xxd ?
If it's only a couple of images on the page you could embed them directly in the html as base64 before you convert the html to hex array:
<img alt="Embedded Image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." />
If you want to be super efficient, gzip the html page including the embedded base64 images before you convert to a hex array, and then set the Content-Encoding response header to "gzip"
<img alt="Embedded Image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." />
If you want to be super efficient, gzip the html page including the embedded base64 images before you convert to a hex array, and then set the Content-Encoding response header to "gzip"
Re: embedded images in html file with xxd ?
thank you so much for your help, I can't tell you how much I appreciate it.
Who is online
Users browsing this forum: No registered users and 117 guests