Compress JPEG fail at jpeg_set_default
Hi,
I am a newbie and trying to compress RGB image data to JPEG and save to SD card. Step by step I monitor the debugging of CubeMX, which is very useful to me. And finally I see it can not pass the jpeg_set_default() function due to "out of memory", does this mean I need to upgrade to high memory MCU? btw, I do not allocate memory for cinfo, before the main(), I declare cinfo as structure instead of a structure pointer.
I hope to get your support. thank you!!!
it stops here (as below) inside the jpeg_set_default( )
/* Allocate comp_info array large enough for maximum component count.
* Array is made permanent in case application wants to compress
* multiple images at same param settings.
*/
if (cinfo->comp_info == NULL)
cinfo->comp_info = (jpeg_component_info *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
MAX_COMPONENTS * SIZEOF(jpeg_component_info));
