2023-08-02 10:39 PM
I'm trying to read a .JPG image file from my SD Card (FATFS) and want to use LIBJPEG for decoding it. Everything seems to be fine until I execute the **jpeg_start_decompress()** function. As soon as this ifunction is executed a UsageFault is generated on the MCU, does anyone know why would this be happening?
Here is my code for loading the jpg image:
Solved! Go to Solution.
2023-08-03 07:55 AM
Hello @Devashish_Lahariya,
It is possible you are linking decompression library into the transcoder. Note if an application links in jpeg_start_decompress(), it will end up linking in the entire decompressor. You thus must separate jdapistd.c file from jdapimin.c. For further details read LibJPEG documentaiton.
Also, make sure decompression initialization must be completed before calling jpeg_start_decompress().
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-08-03 07:55 AM
Hello @Devashish_Lahariya,
It is possible you are linking decompression library into the transcoder. Note if an application links in jpeg_start_decompress(), it will end up linking in the entire decompressor. You thus must separate jdapistd.c file from jdapimin.c. For further details read LibJPEG documentaiton.
Also, make sure decompression initialization must be completed before calling jpeg_start_decompress().
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-06-14 10:45 AM
Hello, I have the exact same problem and use the same MCU.
Indeed, I ended up with an executable of 182Kb because all the JPED library has been linked.
This is not a problem in itself but the solution asks to separate 2 specific jpeg files.
What do you mean?
Also where can we access the LibJPEG documentation?
Best regards.