Skip to content

graphics/libjpeg: Add JPEG compressor support to Makefile #3127

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

keever50
Copy link

Summary

This PR adds the required JPEG compressor files to the Makefile.
Before this PR, the Makefile contained only the required decompressor files.

Impact

Users can now use the JPEG compressor. All the required files are added by default.

Testing

Tested on the STM32H7.
A couple photos were decompressed with 1:8 scaling.
Then compressed again with 20% quality.

JPEG hardware was not used.

nsh> resize sd/PROC/11c.jpg sd/PROC/test.jpg 8 20
Resized JPEG written to sd/PROC/test.jpg
nsh> resize sd/PROC/11c.jpg sd/PROC/test.jpg 8 20
Resized JPEG written to sd/PROC/test.jpg
nsh> 

And as expected, the output looks correct.

Before this PR only the decompressor files were added to the Makefile.
Now all the required compressor files are added.
Decompression and compression tested on STM32H7 with 1:8 JPEG scaling.

Signed-off-by: Kevin Witteveen (MartiniMarter) <[email protected]>
@keever50 keever50 changed the title Add JPEG compressor support to Makefile graphics/libjpeg: Add JPEG compressor support to Makefile Jul 11, 2025
@keever50
Copy link
Author

I can clean up the JPEG resize tool and share it with NuttX as well if we think this is nice to have

@cederom
Copy link
Contributor

cederom commented Jul 11, 2025

Thanks @keever50 :-) Only sources needs to be added no application code? :-)

CI failed for some reason, restarted :-)

@xiaoxiang781216
Copy link
Contributor

I can clean up the JPEG resize tool and share it with NuttX as well if we think this is nice to have

yes, I think it's useful tool and demo.

@keever50
Copy link
Author

Thanks @keever50 :-) Only sources needs to be added no application code? :-)

CI failed for some reason, restarted :-)

That's right yep. I think it is possible to add code to make JPEG run more efficient or to take advantage of JPEG hardware. But right now it is just stock.

CI is still failing. Not sure why.

About the resize tool, I can make a separate PR for this.

@keever50
Copy link
Author

I can clean up the JPEG resize tool and share it with NuttX as well if we think this is nice to have

yes, I think it's useful tool and demo.

While we are here, should this upcoming app be under the /example dir? It is an actual tool that could be used to resize images in production. Like in scripts. We are using this to create thumbnails.

I dont see any /tools dir that contain actual tool applications.
Maybe this is something worth adding?

@xiaoxiang781216
Copy link
Contributor

I can clean up the JPEG resize tool and share it with NuttX as well if we think this is nice to have

yes, I think it's useful tool and demo.

While we are here, should this upcoming app be under the /example dir? It is an actual tool that could be used to resize images in production. Like in scripts. We are using this to create thumbnails.

I dont see any /tools dir that contain actual tool applications. Maybe this is something worth adding?

could put it into apps/graphics or apps/system folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants