2017-01-24 04:17 AM
Hi.
I'm using STM32CubeF4 1.14.0 with STemWin 5.32.
I need to draw JPEGs from file using the DrawEx functions where the user has to provide a getData function which reads chunks of data from a file.
However the ...DrawEx functions do not provide any possibilty to cancel an ongoing drawing. As decoding of JPEG files need a lot of time it is necessary to have a possibility to cancel an ongoing drawing. At the moment you always have to wait until the image is fully loaded which may take a long time depending on the size of the image.
The Segger manual states that the drawing function will return immediately if the getData function doesn't return the requested number of bytes whereas the STemWin manual says that the function always has to return at least 1 Byte.
I tried to return 0 in the getData function but this will not cancel an ongoing loading of data from the image file. Instead the function will never return even when it gets no data at all.
In my opinion this is a perfect bug and should be fixed as soon as possible. Without the possibilty to cancel loading the data the library can not be used e.g. for applications like picture frames because one has to react fast on any user input instead to wait for seconds until loading and decompression has finished.
Is there any other possibilty to SAFELY cancel these drawing functions?. This is related to :
2017-01-26 08:43 AM
Hello ra hummel,
Your issue is reported in our development team for more investigation and will come back to you with the feedback then.
What is the memory that you have spend ? Maybe a decoding take a lot time due to the JPEG memory requirement ? Try to increase the size of the memory, this may help.
Please, keep us informed about your update on your project.
Regards
Imen
2017-01-26 08:38 PM
can you run the jpeg decoder in a thread ?
can you terminate a thread ?
2017-01-26 10:40 PM
Memory size is not the problem and also decoding is not the problem im fine with that. The problem is that one does not have any possiblity to cancel the image processing even if you return zero bytes in the getData function.
Sure I could use memory devices and run the decoder in a separate thread, but terminating or to cancel the thread is not an option because of memory leaks that may be produced by emwin (see:
).2017-03-13 01:48 AM
Hi!
I am new using emWin and I am trying to load jpeg images into memory without using conversion to c format. I am using Keil compiler and I am suposing that putting the file within the project folder will be enough in order to use the JPEG API.
I cannot try it because this API uses the windows.h library which it is not available for keil because it is not a GNU compiler.
So my question is, how can I do it?
Another thing is that you have talked about the STemWin manual, but I have only found the Getting Started manual where there aren't a reference of any function or API, Where can I find that manual?
Thanks!!
2017-03-13 04:58 AM
Hi,
I think you have download the STemwin package from this
http://www.st.com/en/embedded-software/stemwin.html
page and refer to the Getting Started AN4323.So, you asked to have the
.Imen
2017-03-13 05:52 AM
Hi,
I already have the segger manual. What I was asking for, was the STemwin manual as ra hummel said in his first post:
The Segger manual states that the drawing function will return immediately if the getData function doesn't return the requested number of bytes whereas the STemWin manual says that the function always has to return at least 1 Byte.
Anyway, what I want to know is how to store a jpeg image within the memory of the 32F429IDISCOVERY Board without converting it to c format, because when you convert it, the c file size is bigger than the jpeg file size, so I want to try to use the jpep file and load it into a memory device in order to check how it is better way of use for my application.
Thanks!
Sergio.
2017-03-16 02:33 AM
I am still having this problem. All the examples I have found include the 'windows' library and I am not able to find it for use with keil.
Can someone show me how to load extern files like jpeg into RAM?
Thanks.
2017-03-16 02:55 AM
You have a method but keep stating you don't want to use that method. The compiler condenses the byte array back to nominal size, in a format the linker can manage.
Your alternative is to convert to an object file and link that in, or add SDIO and FATFS support and put the image files on a microsd card.
2017-03-23 02:01 AM
Download STM32Cube for your MCU (e.g. STM32CubeF4 for STM32F4XX MCUs) and unzip it. You will find STemWin in the sub folder Middlewares\ST\STemWin and the manual in Middlewares\ST\STemWin\Documentation\STemWin532.pdf.
Open the manual and have a look into chapter '9.2 JPEG file support'. You will find an example about how to load a JPEG file from ROM in chapter 9.2.2.
BTW you will find a starter application in Projects\STM32F429I-Discovery\Applications\STemWin