ESP32-Trinity icon indicating copy to clipboard operation
ESP32-Trinity copied to clipboard

DisplayImageFromWeb example doesn't work with JPEGDEC 1.2.2+

Open joelhaasnoot opened this issue 3 years ago • 3 comments

Tested to work with

1.1.1
1.2.0
1.2.1

Error with 1.2.2+ is

invalid conversion from 'void (*)(JPEGDRAW*)' {aka 'void (*)(jpeg_draw_tag*)'} to 'int (*)(JPEGDRAW*)' {aka 'int (*)(jpeg_draw_tag*)'} [-fpermissive]

joelhaasnoot avatar Dec 12 '21 15:12 joelhaasnoot

I was able to get around the error above by modifying the following in code.

int JPEGDraw(JPEGDRAW *pDraw)
{
  // Stop further decoding as image is running off bottom of screen
  if (  pDraw->y >= dma_display->height() ){
    return 0;
  }

  dma_display->drawRGBBitmap(pDraw->x, pDraw->y, pDraw->pPixels, pDraw->iWidth, pDraw->iHeight);

  return 1;
}

However, I'm getting a new error now that looks be in the JPEGDEC library. Any ideas? I'm using PlatformIO.

In file included from src/main.cpp:47:
.pio/libdeps/wemos_d1_mini32/JPEGDEC/src/JPEGDEC.h:216:14: error: 'File' has not been declared
     int open(File &file, JPEG_DRAW_CALLBACK *pfnDraw);
              ^~~~

brianlich avatar Dec 21 '22 03:12 brianlich

did you fix it? same problem here

clajarac avatar Sep 06 '23 15:09 clajarac

I had the same issue:

In file included from src/main.cpp:47: .pio/libdeps/wemos_d1_mini32/JPEGDEC/src/JPEGDEC.h:216:14: error: 'File' has not been declared int open(File &file, JPEG_DRAW_CALLBACK *pfnDraw); ^~~~

I'm using a TFT_eSPI library, and disabling the SMOOTH_FONT in the TFT Setup I fixed it. Maybe could have relation with your issue.

hpsaturn avatar Oct 04 '23 22:10 hpsaturn