M5GFX icon indicating copy to clipboard operation
M5GFX copied to clipboard

Drawing images from URL (e.g. drawPngUrl) does not work if response is chunked

Open Lazyuki opened this issue 1 year ago • 0 comments

Example: this png is returned with a Transfer-Encoding: chunked header and M5GFX can't render it with drawPngUrl.

This happens because each chunk in the tcp stream has a chunk-header (chunkLength\r\n) and a trailer (\r\n), but the drawImg##Url function does not take this into account so it thinks the stream is not a valid PNG and cannot render it. M5GFX should do something like https://github.com/espressif/arduino-esp32/blob/ee8931d151665ffc6bb52e3edb9509a6d8e5c401/libraries/HTTPClient/src/HTTPClient.cpp#L885-L934 to make sure images that get sent with chunks can be rendered.

Lazyuki avatar Oct 18 '24 00:10 Lazyuki