Visualization problems on some JPEG files.

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Visualization problems on some JPEG files.

    Dear sirs,

    by long time we are successfully using emWin.
    We use emWin on NXP LPC1788 mcu + 4.3 or 7 inches color displays.
    During the last days we are facing a very strange problem on JPG file visualization. We normally use GUI_JPEG_DrawScaledEx(GUI_GET_DATA_FUNC * pfGetData, void * p, int x0, int y0, int Num, int Denom)
    but some JPG file make the whole application crash!! The file is normally shown on PC/Windows and it is not a dimension/memory problem; it seems it is related to that file only!
    We attached such a file.


    In the last years we know that JPG file format has changed and several new markers have been added to header section (like JFIF, EXIF, etc.) and we suspect that emWin library has some problems with Progressive JPG file (its related marker is 0xFF 0xC2). Is it possible? Is there a list where allowed JPG sub-format are shown? Or we ask for a suggestion to read these markers on JPG file (actually we have only GUI_JPEG_GetInfo(const void * pFileData, int DataSize, GUI_JPEG_INFO * pInfo) that returns X and Y dimensions only).

    Thank you in advance.

    Best regards,

    Valter Rasicci
    Images
    • Jimenez_dragan.jpg

      258.74 kB, 2,406×2,124, viewed 692 times
  • Hello Valter,

    I was able to display your JPEG file with emWin using the following code:

    C Source Code

    1. #include "GUI.h"
    2. /*********************************************************************
    3. *
    4. * MainTask
    5. */
    6. void MainTask(void) {
    7. GUI_JPEG_INFO Info;
    8. int XSize;
    9. int YSize;
    10. int XPos;
    11. int YPos;
    12. GUI_Init();
    13. GUI_JPEG_GetInfo(_acJimenez_dragan, sizeof(_acJimenez_dragan), &Info);
    14. XSize = Info.XSize;
    15. YSize = Info.YSize;
    16. XPos = (XSize > 320) ? 0 : 160 - (XSize / 2);
    17. YPos = (YSize > 180) ? 60 : 150 - (YSize / 2);
    18. GUI_JPEG_Draw(_acJimenez_dragan, sizeof(_acJimenez_dragan), XPos, YPos);
    19. while (1) {
    20. GUI_Delay(100);
    21. }
    22. }
    23. /*************************** End of file ****************************/
    Display All

    Best regards,
    Adrian
    Images
    • Jimenez_dragan_emWin.jpg

      401.28 kB, 1,316×1,465, viewed 551 times
  • Hi Adrian,

    it works on a PC. The problem is that it causes crash on the whole application when running on LPC1788 mpu. Moreover we used GUI_JPEG_DrawScaledEx instead of your GUI_JPEG_Draw.
    Really, just yesterday, we read in the following link http://www.keil.com/pack/doc/mw/graphic/html/release.html , in Program corrections section that some problems where effectively present on the library and it was solved on 5.24a version. Please look at the section we coloured in red we reported below.
    Moreover, it is not a memory problem: actually we have 10Mb of memory dedicated to emWin.

    We didn't tell you that we are not using the last emWin version and, at the moment, it is not simple to change production scheduling so we were asking for a solution/trick to understand whether such files can be identified to avoid application crash. Soon we will move to last emWin release but not immediately.




    Version 5.24a
    1. Display drivers:
      • GUIDRV_Lin: Macro 'MIRROR()' does not exist if LCD_ENDIAN_BIG is defined. Problem solved.
    [*]Widgets:
    • MULTIPAGE widget does not compile with 'GUI_SUPPORT_ROTATION 0'. Problem solved.
    [*]Core:
    • If very short on memory under certain circumstances JPEG decoder could crash. Problem solved.

    Best regards,

    Valter Rasicci

    The post was edited 1 time, last by valterrasicci ().