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

[Patch] Add USE_STBIMAGE for LoadPNG/LoadJPG, USE_TINYJPEG for SaveJPG #133

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.3
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2018-09-04 17:17:22 +0000, Ethan Lee wrote:

Created attachment 3296
stb_image/tinyjpeg support patch

Attached is a patch that uses stb_image and tinyjpeg as fallbacks for configurations where libpng/libjpeg is not available. USE_STBIMAGE and USE_TINYJPEG defines are used to guard those portions of the code.

Notably absent from this patch is project file updates, including ./configure options. It shouldn't be too hard to add, just '--enable-stb-image' and '--enable-tinyjpeg' with both defaulting to 'no' should be enough, and it'll only matter if libpng/libjpeg are disabled/missing.

A test repo is available here:

https://github.com/FNA-XNA/SDL_image_compact

On 2018-09-04 17:25:49 +0000, Ethan Lee wrote:

Oh yeah, one more thing: You'll notice that IsPNG and IsJPG are duplicated for the fallback paths - I wasn't sure how to isolate that, but this could definitely be made smaller by taking the existing copies of the function and expose them to other implementations of PNG/JPG support.

On 2018-10-02 17:15:54 +0000, Ethan Lee wrote:

Created attachment 3336
stb_image/tinyjpeg support patch [v2]

Patch has been updated with some warning fixes for WinRT. Still need to figure out the best way to incorporate this into the projects and merge the IsPNG/IsJPG paths, need feedback on that before this can move forward.

On 2020-01-30 21:59:22 +0000, Ethan Lee wrote:

Created attachment 4183
stb_image/tinyjpeg support patch [v3]

New version to fix a leak in the stb loader.

@SDLBugzilla SDLBugzilla added the enhancement New feature or request label Feb 11, 2021
@slouken
Copy link
Collaborator

slouken commented May 9, 2022

Added in 406fd40, thanks!

@slouken slouken closed this as completed May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants