Skip to main content
bbee
Senior
January 24, 2017
Question

STemWin - GUI_JPEG_DrawEx

  • January 24, 2017
  • 11 replies
  • 3029 views
Posted on January 24, 2017 at 13:17

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 :

  • GUI_BMP_DrawEx, GUI_BMP_DrawScaledEx
  • GUI_JPG_DrawEx, GUI_JPEG_DrawScaledEx
  • GUI_PNG_DrawEx

#stemwin
This topic has been closed for replies.

11 replies

ST Technical Moderator
January 26, 2017
Posted on January 26, 2017 at 17:43

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
T J
Senior III
January 27, 2017
Posted on January 27, 2017 at 05:38

can you run the jpeg decoder in a thread ?

can you terminate a thread ?

bbee
bbeeAuthor
Senior
January 27, 2017
Posted on January 27, 2017 at 07:40

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:

http://forum.segger.com/index.php?page=Thread&threadID=2150

).
Sergio Roldan
Associate II
March 13, 2017
Posted on March 13, 2017 at 09:48

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!!

ST Technical Moderator
March 13, 2017
In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Sergio Roldan
Associate II
March 13, 2017
Posted on March 13, 2017 at 12:52

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.