2019-02-07 10:40 PM
Hi,
I'm trying to load jpeg files in TouchGFX by using the JPEG Loader Library. I have downloaded that from the Git using the link given in TouchGFX Forum. I have added the Library in my project and tried to load a jpeg image. The image was not loaded, the image is placed in the working folder alone. I have set the break point and checked if the file is opened successfully or not. The file was opened successfully but i didn't the image in simulator output . Suggest me a solution for this issue.
Solved! Go to Solution.
2019-02-08 07:06 AM
Fixed it.
You're missing additional parameters to your touchgfx init call. Pointer to cache, size of cache and number of cached bitmaps. If you stepped through the code in your view you would have seen that a dynamic bitmap could not be allocated so the JPEG was never decoded.
Allocate your cache (e.g. in main.cpp) to be large enough to contain the image (240*320)
uint8_t bmpCache[240*320*4];
EDIT: Working project is attached to a post further down this thread.
2019-02-08 03:25 AM
Hi @PBU,
I have your test project. Which compiler are you using?
2019-02-08 03:42 AM
Hi Martin,
I'm using GCC Compiler. But Right now i am using Microsoft Visual Studio for Simulation. The Files are inside the msvs folder generated by TouchGFX Tool.
2019-02-08 07:06 AM
Fixed it.
You're missing additional parameters to your touchgfx init call. Pointer to cache, size of cache and number of cached bitmaps. If you stepped through the code in your view you would have seen that a dynamic bitmap could not be allocated so the JPEG was never decoded.
Allocate your cache (e.g. in main.cpp) to be large enough to contain the image (240*320)
uint8_t bmpCache[240*320*4];
EDIT: Working project is attached to a post further down this thread.
2019-02-08 07:33 AM
2019-02-09 04:34 PM
2019-02-09 08:36 PM
Hi Martin,
Thank you. It Works.
2019-02-11 02:51 AM
Glad it's working for you! You almost made it through creating an example with success using the github code but were just missing some configuration - I'll take this into account and emphasize it when doing the dynamic bitmap / decoding video.
2019-02-11 10:09 PM
Hi Martin,
I have tried the same project using Atollic True Studio. The fopen return FAIL while trying to open .jpg file. Do we need to change any settings to solve this?
2019-02-11 10:36 PM
What does printing errno tell you from that failing call? #include <errno.h>