earthlcd / ezLCD-5x

Public Repository for ezLCD-5035-RT release files system, firmware and issue reporting
https://earthlcd.com/products/ezlcd-5x?_pos=1&_sid=0927d2260&_ss=r
0 stars 1 forks source link

Lua commands to load bitmap files do not work if the file is jpeg format #69

Closed JacobChrist closed 5 months ago

JacobChrist commented 1 year ago

Describe the bug Lua commands to load bitmap files do not work if the file is jpeg format.

Tested with both ez.PutPicNo() and ez.PutPictFile().

Also tested trying to load bmp file (which seem to work fine with both functions.

To Reproduce

    ez.PutPictFile(0, 0, "Images/EarthLCD_320x240_Splash.jpeg") -- doesn't work
    ez.PutPictFile(0, 0, "/Images/EarthLCD_320x240_Splash.jpeg") -- doesn't work
    ez.PutPictFile(0, 0, "Images/EarthLCD_320x240_Splash.bmp")  -- works
    ez.PutPictFile(0, 0, "/Images/EarthLCD_320x240_Splash.bmp") -- works
JacobChrist commented 1 year ago

Here is the firmware version I'm using for the 5035: Ver: 3.0.0 Mar 29 2023 (NoSPI) Lua 5.3.5 S/N: 2c0022000751393334383939 320x240

I confirmed that the gas guage jpg's are working in my autoexec.lua example as well. So it appears that some jpg's render but not others.

Here is my image (jpg) which does not render: pulltest-bg

Here is my bmp & jpg zipped up: pulltest-bg.zip

My bmp does render but it doesn't display how I would expect it to. As you can see the image is offset to the right (and appears to wrap around).
image

The image was generated by opening the jpg in gimp then exporting as a bmp with these settings. image

JacobChrist commented 1 year ago

At the suggestion Randy tried the following (no X,Y):

    local result = ez.PutPictFile("/Images/EarthLCD_320x240_Splash.jpeg")
    ez.SerialTx("result=".. tostring(result) .. "\r\n", 80, debug_port)

Serial output: result=false

Same result, image not displayed.

microlan commented 1 year ago

I suspect this issue may be related to the specific internal JPG format of the file you chose. We have found that the hardware JPEG decoder doesn't seem to work with certain JPG file formats (not really sure why).

JacobChrist commented 1 year ago

Doing more testing on this tonight and jpeg's written from GIMP are still an issue.

JacobChrist commented 1 year ago

By outputting a png from GIMP and running it through this web site to convert to either a bmp or a jpg the file loads:

https://www.onlineconverter.com/

I suspect that this site is outputting older file formats that are compatible with current firmware (March 29, 2023)

Trying the same thing with png->jpg using Windows paint caused the lua code to crash and not even load an image.

JacobChrist commented 1 year ago

Addressed in commit: https://github.com/earthlcd/EZLCD-5xxx-Master/commit/a8ee9e0cce128bca59d7cdbf2892b06de01db48e but not yet released.

JacobChrist commented 5 months ago

Addressed (again) in commit: https://github.com/earthlcd/EZLCD-5xxx-Master/commit/5087ce949399b93036bdf4747b2ef4c6c871a00d and master advanced.

JacobChrist commented 5 months ago

@microlan I've pushed this fix to master and I'm closing.