From ad42e2288f46fe8af11e3fb2fbddf71d03b13f3d Mon Sep 17 00:00:00 2001 From: dylduhamel Date: Thu, 21 Dec 2023 13:31:16 -0500 Subject: [PATCH] Fixed JPEGDraw, incorrect return type for open in JPEGDEC.h. --- .../Images/DisplayImageFromWeb/DisplayImageFromWeb.ino | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/BuildingBlocks/Images/DisplayImageFromWeb/DisplayImageFromWeb.ino b/examples/BuildingBlocks/Images/DisplayImageFromWeb/DisplayImageFromWeb.ino index 33eee85..6fbba6e 100644 --- a/examples/BuildingBlocks/Images/DisplayImageFromWeb/DisplayImageFromWeb.ino +++ b/examples/BuildingBlocks/Images/DisplayImageFromWeb/DisplayImageFromWeb.ino @@ -30,7 +30,6 @@ #include #include -#define FS_NO_GLOBALS #include #include "SPIFFS.h" @@ -101,12 +100,15 @@ WiFiClientSecure client; // This next function will be called during decoding of the jpeg file to // render each block to the Matrix. If you use a different display // you will need to adapt this function to suit. -void JPEGDraw(JPEGDRAW *pDraw) +int JPEGDraw(JPEGDRAW *pDraw) { // Stop further decoding as image is running off bottom of screen - if ( pDraw->y >= dma_display->height() ) return; + if ( pDraw->y >= dma_display->height() ) return 0; dma_display->drawRGBBitmap(pDraw->x, pDraw->y, pDraw->pPixels, pDraw->iWidth, pDraw->iHeight); + + // Return 1 to decode next block + return 1; } void displaySetup() {