witnessmenow / ESP32-Trinity

An Open Source ESP32 board for connecting to HUB75 Matrix Panels
Other
236 stars 32 forks source link

DisplayImageFromWeb example doesn't work with JPEGDEC 1.2.2+ #11

Open joelhaasnoot opened 2 years ago

joelhaasnoot commented 2 years ago

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]
brianlich commented 1 year ago

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);
              ^~~~
clajarac commented 10 months ago

did you fix it? same problem here

hpsaturn commented 9 months ago

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.