bitbank2 / JPEGDEC

An optimized JPEG decoder suitable for microcontrollers and PCs.
Apache License 2.0
390 stars 46 forks source link

Error when trying to use the Linux example #22

Closed tamano123 closed 3 years ago

tamano123 commented 3 years ago

Hello, I tried the Linux example but i got the following error when compiling :

error: passing argument 4 of 'JPEG_openRAM' from incompatible pointer type [-Werror=incompatible-pointer-types] JPEG_openRAM(&jpg, (uint8_t *)o_in, sizeof(o_in),JPEGDraw); ^~~~~~~~ In file included from main.c:11: JPEGDEC.h:234:87: note: expected 'int (*)(JPEGDRAW *)' {aka 'int (*)(struct jpeg_draw_tag *)'} but argument is of type 'void (*)(JPEGDRAW *)' {aka 'void (*)(struct jpeg_draw_tag *)'} int JPEG_openRAM(JPEGIMAGE *pJPEG, uint8_t *pData, int iDataSize, JPEG_DRAW_CALLBACK *pfnDraw);

Any help to solve it ? thank you

bitbank2 commented 3 years ago

I just updated the JPEGDraw callback to return a value of 0 to quit decoding or 1 to continue decoding. I will be updating the examples shortly. Change the function prototype to be "int" instead of "void".