Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JacobChrist opened this issue Apr 3, 2023 · 8 comments
Assignees
Labels
bug Something isn't working Lua needs-review

Comments

@JacobChrist
Copy link
Member

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 JacobChrist added bug Something isn't working Lua labels Apr 3, 2023
@JacobChrist
Copy link
Member Author

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
Copy link
Member Author

JacobChrist commented Apr 3, 2023

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
Copy link
Contributor

microlan commented Apr 4, 2023

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 JacobChrist assigned JacobChrist and unassigned microlan Apr 5, 2023
@JacobChrist
Copy link
Member Author

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

@JacobChrist
Copy link
Member Author

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
Copy link
Member Author

@JacobChrist
Copy link
Member Author

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

@JacobChrist
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Lua needs-review
Projects
None yet
Development

No branches or pull requests

2 participants