SDL_image 2.5.2 is now available as a PRERELEASE build:
This is a release candidate for 2.6.0.
In addition to new CMake support by @madebr and many bug fixes, here are the highlights since the last release:
I’m excited to use this!
I notice this seems to be moving towards the “static build” strategy, like SDL_ttf, where the libraries should be statically linked inside the DLL/lib.
However I’m concerned about what libraries are included in the prebuilt build. It seems to have built in support for everything but tiff, webp, and avif. I’m using the MSVC development prebuilt by the way, on Windows. All other formats seem to work fine, but I’m not sure if SDL_image is finding libs for them somewhere else on my computer or whether they’re bundled. (Other formats I tested: png, bmp, jpg, pcx, tga, xpm, ppm, pgm, svg, pnm, qoi)
With the help of our test suite I’ve also noticed that there may be something up with svg image loading.
Our test case has an image “teal.svg”, which is just a square of teal (0,128,128), and checks that the color is loaded properly. On my test with the new SDL_image version, for some reason, it loads in the color as (128,128,128).
Here’s the image in question:
We include support for as many formats as possible without adding large third party dependencies.
The README.txt has the full list of supported formats:
It can load BMP, GIF, JPEG, LBM, PCX, PNG, PNM (PPM/PGM/PBM), QOI, TGA, XCF, XPM, and simple SVG format images. It can also load AVIF, JPEG-XL, TIFF, and WebP images, depending on build options (see the note below for details.)
Thanks for the explanation. It is certainly an impressive size reduction versus the 2.0.5 prebuilt.
My use case is as one of the developers of pygame, so I’d like to maintain support for webp and tiff, since that has been around for a while (very conveniently w/ the old prebuilt).
I’m a bit scared of compiling SDL_image on Windows, I’ve tried in the past without much luck.
I’m not sure if this is possible, but could we have a build that is statically linked to all the small libs but can dynamically link to the larger ones? That way I could take the prebuilt from SDL_image and just add the DLLs for webp and tiff and have it work?
Yep, the final Windows release binaries will have support for dynamically loading TIFF, WEBP, and JXL.
I mean “support for dynamically loading TIFF and WebP”
Should this be done for avif as well? Or for midi/mod/opus in SDL_mixer?
MOD and Opus support are optional and built for the final Windows release. If you want libraries that support all formats, you’ll probably want to build them yourself. avif, jxl, and MIDI support are all disabled by default because of the size, complexity of building them, or additional runtime data requirements.
By “this” I mean add support for dynamic loading of avif like you did for webp and tiff in this commit: Added support for dynamically loading TIFF and WebP support to the Vi… · libsdl-org/SDL_image@fd7b686 · GitHub
Good to know MOD and Opus are built in still, that explains why the automated testing was still happy with SDL_mixer 2.5.2.
The hopefully final release candidate for 2.6.0 is now available: