diff --git a/src/libs/tjpgd/lv_tjpgd.c b/src/libs/tjpgd/lv_tjpgd.c index 7872ea1e4e..3208d1aa13 100644 --- a/src/libs/tjpgd/lv_tjpgd.c +++ b/src/libs/tjpgd/lv_tjpgd.c @@ -200,6 +200,7 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d lv_free(f); lv_free(workb_temp); lv_free(jd); + LV_LOG_WARN("jd_prepare error: %d", rc); return LV_RESULT_INVALID; } @@ -240,7 +241,10 @@ static lv_result_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decod else { lv_fs_seek(jd->device, 0, LV_FS_SEEK_SET); JRESULT rc = jd_prepare(jd, input_func, jd->pool_original, (size_t)TJPGD_WORKBUFF_SIZE, jd->device); - if(rc) return LV_RESULT_INVALID; + if(rc) { + LV_LOG_WARN("jd_prepare error: %d", rc); + return LV_RESULT_INVALID; + } } decoded->data = jd->workbuf; decoded->header = dsc->header; @@ -268,17 +272,26 @@ static lv_result_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decod JRESULT rc; if(jd->nrst && jd->rst++ == jd->nrst) { rc = jd_restart(jd, jd->rsc++); - if(rc != JDR_OK) return LV_RESULT_INVALID; + if(rc != JDR_OK) { + LV_LOG_WARN("jd_restart error: %d", rc); + return LV_RESULT_INVALID; + } jd->rst = 1; } /* Load an MCU (decompress huffman coded stream, dequantize and apply IDCT) */ rc = jd_mcu_load(jd); - if(rc != JDR_OK) return LV_RESULT_INVALID; + if(rc != JDR_OK) { + LV_LOG_WARN("jd_mcu_load error: %d", rc); + return LV_RESULT_INVALID; + } /* Output the MCU (YCbCr to RGB, scaling and output) */ rc = jd_mcu_output(jd, NULL, decoded_area->x1, decoded_area->y1); - if(rc != JDR_OK) return LV_RESULT_INVALID; + if(rc != JDR_OK) { + LV_LOG_WARN("jd_mcu_output error: %d", rc); + return LV_RESULT_INVALID; + } return LV_RESULT_OK; }