SDL_image: Cleanup (7d736)

From 7d736ec4ec7ff1b807cc6bef92c07a3ec6df7b00 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 22 Oct 2025 13:04:28 -0700
Subject: [PATCH] Cleanup

---
 include/SDL3_image/SDL_image.h | 539 +++++++++++++++++----------------
 src/IMG.c                      | 146 ++++-----
 src/IMG_ani.c                  |  13 +-
 src/IMG_anim_decoder.c         |  25 ++
 src/IMG_avif.c                 |  17 +-
 src/IMG_bmp.c                  |   3 +
 src/IMG_gif.c                  |  15 +-
 src/IMG_jpg.c                  |   1 +
 src/IMG_jxl.c                  |   1 +
 src/IMG_lbm.c                  |   1 +
 src/IMG_libpng.c               |  25 +-
 src/IMG_pcx.c                  |   1 +
 src/IMG_png.c                  |   1 +
 src/IMG_pnm.c                  |   1 +
 src/IMG_qoi.c                  |   1 +
 src/IMG_svg.c                  |   1 +
 src/IMG_tga.c                  |   1 +
 src/IMG_tif.c                  |   1 +
 src/IMG_webp.c                 |  16 +-
 src/IMG_xcf.c                  |   1 +
 src/IMG_xpm.c                  |   3 +
 src/IMG_xv.c                   |   1 +
 src/IMG_xxx.c                  |  14 +-
 23 files changed, 409 insertions(+), 419 deletions(-)

diff --git a/include/SDL3_image/SDL_image.h b/include/SDL3_image/SDL_image.h
index 05213848..4c72b97c 100644
--- a/include/SDL3_image/SDL_image.h
+++ b/include/SDL3_image/SDL_image.h
@@ -71,7 +71,7 @@ extern "C" {
 extern SDL_DECLSPEC int SDLCALL IMG_Version(void);
 
 /**
- * Load an image from an SDL data source into a software surface.
+ * Load an image from a filesystem path into a software surface.
  *
  * An SDL_Surface is a buffer of pixels in memory accessible by the CPU. Use
  * this if you plan to hand the data to something else or manipulate it
@@ -91,48 +91,31 @@ extern SDL_DECLSPEC int SDLCALL IMG_Version(void);
  * by calling: SDL_SetSurfaceColorKey(image, SDL_RLEACCEL,
  * image->format->colorkey);
  *
- * If `closeio` is true, `src` will be closed before returning, whether this
- * function succeeds or not. SDL_image reads everything it needs from `src`
- * during this call in any case.
- *
- * Even though this function accepts a file type, SDL_image may still try
- * other decoders that are capable of detecting file type from the contents of
- * the image data, but may rely on the caller-provided type string for formats
- * that it cannot autodetect. If `type` is NULL, SDL_image will rely solely on
- * its ability to guess the format.
- *
- * There is a separate function to read files from disk without having to deal
- * with SDL_IOStream: `IMG_Load("filename.jpg")` will call this function and
- * manage those details for you, determining the file type from the filename's
- * extension.
- *
- * There is also IMG_Load_IO(), which is equivalent to this function except
- * that it will rely on SDL_image to determine what type of data it is
- * loading, much like passing a NULL for type.
+ * There is a separate function to read files from an SDL_IOStream, if you
+ * need an i/o abstraction to provide data from anywhere instead of a simple
+ * filesystem read; that function is IMG_Load_IO().
  *
  * If you are using SDL's 2D rendering API, there is an equivalent call to
  * load images directly into an SDL_Texture for use by the GPU without using a
- * software surface: call IMG_LoadTextureTyped_IO() instead.
+ * software surface: call IMG_LoadTexture() instead.
  *
  * When done with the returned surface, the app should dispose of it with a
- * call to SDL_DestroySurface().
+ * call to
+ * [SDL_DestroySurface](https://wiki.libsdl.org/SDL3/SDL_DestroySurface)
+ * ().
  *
- * \param src an SDL_IOStream that data will be read from.
- * \param closeio true to close/free the SDL_IOStream before returning, false
- *                to leave it open.
- * \param type a filename extension that represent this data ("BMP", "GIF",
- *             "PNG", etc).
+ * \param file a path on the filesystem to load an image from.
  * \returns a new SDL surface, or NULL on error.
  *
  * \since This function is available since SDL_image 3.0.0.
  *
- * \sa IMG_Load
+ * \sa IMG_LoadTyped_IO
  * \sa IMG_Load_IO
  */
-extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_IO(SDL_IOStream *src, bool closeio, const char *type);
+extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
 
 /**
- * Load an image from a filesystem path into a software surface.
+ * Load an image from an SDL data source into a software surface.
  *
  * An SDL_Surface is a buffer of pixels in memory accessible by the CPU. Use
  * this if you plan to hand the data to something else or manipulate it
@@ -152,28 +135,37 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_IO(SDL_IOStream *src, bo
  * by calling: SDL_SetSurfaceColorKey(image, SDL_RLEACCEL,
  * image->format->colorkey);
  *
- * There is a separate function to read files from an SDL_IOStream, if you
- * need an i/o abstraction to provide data from anywhere instead of a simple
- * filesystem read; that function is IMG_Load_IO().
+ * If `closeio` is true, `src` will be closed before returning, whether this
+ * function succeeds or not. SDL_image reads everything it needs from `src`
+ * during this call in any case.
+ *
+ * There is a separate function to read files from disk without having to deal
+ * with SDL_IOStream: `IMG_Load("filename.jpg")` will call this function and
+ * manage those details for you, determining the file type from the filename's
+ * extension.
+ *
+ * There is also IMG_LoadTyped_IO(), which is equivalent to this function
+ * except a file extension (like "BMP", "JPG", etc) can be specified, in case
+ * SDL_image cannot autodetect the file format.
  *
  * If you are using SDL's 2D rendering API, there is an equivalent call to
  * load images directly into an SDL_Texture for use by the GPU without using a
- * software surface: call IMG_LoadTexture() instead.
+ * software surface: call IMG_LoadTexture_IO() instead.
  *
  * When done with the returned surface, the app should dispose of it with a
- * call to
- * [SDL_DestroySurface](https://wiki.libsdl.org/SDL3/SDL_DestroySurface)
- * ().
+ * call to SDL_DestroySurface().
  *
- * \param file a path on the filesystem to load an image from.
+ * \param src an SDL_IOStream that data will be read from.
+ * \param closeio true to close/free the SDL_IOStream before returning, false
+ *                to leave it open.
  * \returns a new SDL surface, or NULL on error.
  *
  * \since This function is available since SDL_image 3.0.0.
  *
+ * \sa IMG_Load
  * \sa IMG_LoadTyped_IO
- * \sa IMG_Load_IO
  */
-extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
+extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_Load_IO(SDL_IOStream *src, bool closeio);
 
 /**
  * Load an image from an SDL data source into a software surface.
@@ -200,18 +192,24 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
  * function succeeds or not. SDL_image reads everything it needs from `src`
  * during this call in any case.
  *
+ * Even though this function accepts a file type, SDL_image may still try
+ * other decoders that are capable of detecting file type from the contents of
+ * the image data, but may rely on the caller-provided type string for formats
+ * that it cannot autodetect. If `type` is NULL, SDL_image will rely solely on
+ * its ability to guess the format.
+ *
  * There is a separate function to read files from disk without having to deal
  * with SDL_IOStream: `IMG_Load("filename.jpg")` will call this function and
  * manage those details for you, determining the file type from the filename's
  * extension.
  *
- * There is also IMG_LoadTyped_IO(), which is equivalent to this function
- * except a file extension (like "BMP", "JPG", etc) can be specified, in case
- * SDL_image cannot autodetect the file format.
+ * There is also IMG_Load_IO(), which is equivalent to this function except
+ * that it will rely on SDL_image to determine what type of data it is
+ * loading, much like passing a NULL for type.
  *
  * If you are using SDL's 2D rendering API, there is an equivalent call to
  * load images directly into an SDL_Texture for use by the GPU without using a
- * software surface: call IMG_LoadTexture_IO() instead.
+ * software surface: call IMG_LoadTextureTyped_IO() instead.
  *
  * When done with the returned surface, the app should dispose of it with a
  * call to SDL_DestroySurface().
@@ -219,14 +217,16 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
  * \param src an SDL_IOStream that data will be read from.
  * \param closeio true to close/free the SDL_IOStream before returning, false
  *                to leave it open.
+ * \param type a filename extension that represent this data ("BMP", "GIF",
+ *             "PNG", etc).
  * \returns a new SDL surface, or NULL on error.
  *
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_Load
- * \sa IMG_LoadTyped_IO
+ * \sa IMG_Load_IO
  */
-extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_Load_IO(SDL_IOStream *src, bool closeio);
+extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_IO(SDL_IOStream *src, bool closeio, const char *type);
 
 /**
  * Load an image from a filesystem path into a GPU texture.
@@ -399,23 +399,23 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_GetClipboardImage(void);
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
 extern SDL_DECLSPEC bool SDLCALL IMG_isANI(SDL_IOStream *src);
 
@@ -443,28 +443,28 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isANI(SDL_IOStream *src);
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_isANI
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
 extern SDL_DECLSPEC bool SDLCALL IMG_isAVIF(SDL_IOStream *src);
 
 /**
- * Detect ICO image data on a readable/seekable SDL_IOStream.
+ * Detect CUR image data on a readable/seekable SDL_IOStream.
  *
  * This function attempts to determine if a file is a given filetype, reading
  * the least amount possible from the SDL_IOStream (usually a few bytes).
@@ -482,33 +482,33 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isAVIF(SDL_IOStream *src);
  * determine file type in many cases in its standard load functions.
  *
  * \param src a seekable/readable SDL_IOStream to provide image data.
- * \returns true if this is ICO data, false otherwise.
+ * \returns true if this is CUR data, false otherwise.
  *
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isCUR
  * \sa IMG_isBMP
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
-extern SDL_DECLSPEC bool SDLCALL IMG_isICO(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isCUR(SDL_IOStream *src);
 
 /**
- * Detect CUR image data on a readable/seekable SDL_IOStream.
+ * Detect BMP image data on a readable/seekable SDL_IOStream.
  *
  * This function attempts to determine if a file is a given filetype, reading
  * the least amount possible from the SDL_IOStream (usually a few bytes).
@@ -526,33 +526,33 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isICO(SDL_IOStream *src);
  * determine file type in many cases in its standard load functions.
  *
  * \param src a seekable/readable SDL_IOStream to provide image data.
- * \returns true if this is CUR data, false otherwise.
+ * \returns true if this is BMP data, false otherwise.
  *
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
-extern SDL_DECLSPEC bool SDLCALL IMG_isCUR(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isBMP(SDL_IOStream *src);
 
 /**
- * Detect BMP image data on a readable/seekable SDL_IOStream.
+ * Detect GIF image data on a readable/seekable SDL_IOStream.
  *
  * This function attempts to determine if a file is a given filetype, reading
  * the least amount possible from the SDL_IOStream (usually a few bytes).
@@ -570,33 +570,33 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isCUR(SDL_IOStream *src);
  * determine file type in many cases in its standard load functions.
  *
  * \param src a seekable/readable SDL_IOStream to provide image data.
- * \returns true if this is BMP data, false otherwise.
+ * \returns true if this is GIF data, false otherwise.
  *
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
+ * \sa IMG_isBMP
  * \sa IMG_isCUR
- * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
-extern SDL_DECLSPEC bool SDLCALL IMG_isBMP(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isGIF(SDL_IOStream *src);
 
 /**
- * Detect GIF image data on a readable/seekable SDL_IOStream.
+ * Detect ICO image data on a readable/seekable SDL_IOStream.
  *
  * This function attempts to determine if a file is a given filetype, reading
  * the least amount possible from the SDL_IOStream (usually a few bytes).
@@ -614,30 +614,30 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isBMP(SDL_IOStream *src);
  * determine file type in many cases in its standard load functions.
  *
  * \param src a seekable/readable SDL_IOStream to provide image data.
- * \returns true if this is GIF data, false otherwise.
+ * \returns true if this is ICO data, false otherwise.
  *
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
+ * \sa IMG_isGIF
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
-extern SDL_DECLSPEC bool SDLCALL IMG_isGIF(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isICO(SDL_IOStream *src);
 
 /**
  * Detect JPG image data on a readable/seekable SDL_IOStream.
@@ -664,22 +664,22 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isGIF(SDL_IOStream *src);
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
 extern SDL_DECLSPEC bool SDLCALL IMG_isJPG(SDL_IOStream *src);
 
@@ -708,22 +708,22 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isJPG(SDL_IOStream *src);
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
 extern SDL_DECLSPEC bool SDLCALL IMG_isJXL(SDL_IOStream *src);
 
@@ -752,22 +752,22 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isJXL(SDL_IOStream *src);
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
 extern SDL_DECLSPEC bool SDLCALL IMG_isLBM(SDL_IOStream *src);
 
@@ -796,22 +796,22 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isLBM(SDL_IOStream *src);
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
 extern SDL_DECLSPEC bool SDLCALL IMG_isPCX(SDL_IOStream *src);
 
@@ -840,22 +840,22 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isPCX(SDL_IOStream *src);
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
 extern SDL_DECLSPEC bool SDLCALL IMG_isPNG(SDL_IOStream *src);
 
@@ -884,27 +884,27 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isPNG(SDL_IOStream *src);
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
 extern SDL_DECLSPEC bool SDLCALL IMG_isPNM(SDL_IOStream *src);
 
 /**
- * Detect SVG image data on a readable/seekable SDL_IOStream.
+ * Detect QOI image data on a readable/seekable SDL_IOStream.
  *
  * This function attempts to determine if a file is a given filetype, reading
  * the least amount possible from the SDL_IOStream (usually a few bytes).
@@ -922,33 +922,33 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isPNM(SDL_IOStream *src);
  * determine file type in many cases in its standard load functions.
  *
  * \param src a seekable/readable SDL_IOStream to provide image data.
- * \returns true if this is SVG data, false otherwise.
+ * \returns true if this is QOI data, false otherwise.
  *
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
-extern SDL_DECLSPEC bool SDLCALL IMG_isSVG(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isQOI(SDL_IOStream *src);
 
 /**
- * Detect QOI image data on a readable/seekable SDL_IOStream.
+ * Detect SVG image data on a readable/seekable SDL_IOStream.
  *
  * This function attempts to determine if a file is a given filetype, reading
  * the least amount possible from the SDL_IOStream (usually a few bytes).
@@ -966,30 +966,30 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isSVG(SDL_IOStream *src);
  * determine file type in many cases in its standard load functions.
  *
  * \param src a seekable/readable SDL_IOStream to provide image data.
- * \returns true if this is QOI data, false otherwise.
+ * \returns true if this is SVG data, false otherwise.
  *
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
+ * \sa IMG_isQOI
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
-extern SDL_DECLSPEC bool SDLCALL IMG_isQOI(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isSVG(SDL_IOStream *src);
 
 /**
  * Detect TIFF image data on a readable/seekable SDL_IOStream.
@@ -1016,27 +1016,27 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isQOI(SDL_IOStream *src);
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
 extern SDL_DECLSPEC bool SDLCALL IMG_isTIF(SDL_IOStream *src);
 
 /**
- * Detect XCF image data on a readable/seekable SDL_IOStream.
+ * Detect WEBP image data on a readable/seekable SDL_IOStream.
  *
  * This function attempts to determine if a file is a given filetype, reading
  * the least amount possible from the SDL_IOStream (usually a few bytes).
@@ -1054,33 +1054,33 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isTIF(SDL_IOStream *src);
  * determine file type in many cases in its standard load functions.
  *
  * \param src a seekable/readable SDL_IOStream to provide image data.
- * \returns true if this is XCF data, false otherwise.
+ * \returns true if this is WEBP data, false otherwise.
  *
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isXCF
  * \sa IMG_isXPM
  * \sa IMG_isXV
- * \sa IMG_isWEBP
  */
-extern SDL_DECLSPEC bool SDLCALL IMG_isXCF(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isWEBP(SDL_IOStream *src);
 
 /**
- * Detect XPM image data on a readable/seekable SDL_IOStream.
+ * Detect XCF image data on a readable/seekable SDL_IOStream.
  *
  * This function attempts to determine if a file is a given filetype, reading
  * the least amount possible from the SDL_IOStream (usually a few bytes).
@@ -1098,33 +1098,33 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isXCF(SDL_IOStream *src);
  * determine file type in many cases in its standard load functions.
  *
  * \param src a seekable/readable SDL_IOStream to provide image data.
- * \returns true if this is XPM data, false otherwise.
+ * \returns true if this is XCF data, false otherwise.
  *
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
- * \sa IMG_isXCF
- * \sa IMG_isXV
  * \sa IMG_isWEBP
+ * \sa IMG_isXPM
+ * \sa IMG_isXV
  */
-extern SDL_DECLSPEC bool SDLCALL IMG_isXPM(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isXCF(SDL_IOStream *src);
 
 /**
- * Detect XV image data on a readable/seekable SDL_IOStream.
+ * Detect XPM image data on a readable/seekable SDL_IOStream.
  *
  * This function attempts to determine if a file is a given filetype, reading
  * the least amount possible from the SDL_IOStream (usually a few bytes).
@@ -1142,33 +1142,33 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isXPM(SDL_IOStream *src);
  * determine file type in many cases in its standard load functions.
  *
  * \param src a seekable/readable SDL_IOStream to provide image data.
- * \returns true if this is XV data, false otherwise.
+ * \returns true if this is XPM data, false otherwise.
  *
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
- * \sa IMG_isXCF
- * \sa IMG_isXPM
  * \sa IMG_isWEBP
+ * \sa IMG_isXCF
+ * \sa IMG_isXV
  */
-extern SDL_DECLSPEC bool SDLCALL IMG_isXV(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isXPM(SDL_IOStream *src);
 
 /**
- * Detect WEBP image data on a readable/seekable SDL_IOStream.
+ * Detect XV image data on a readable/seekable SDL_IOStream.
  *
  * This function attempts to determine if a file is a given filetype, reading
  * the least amount possible from the SDL_IOStream (usually a few bytes).
@@ -1186,30 +1186,30 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isXV(SDL_IOStream *src);
  * determine file type in many cases in its standard load functions.
  *
  * \param src a seekable/readable SDL_IOStream to provide image data.
- * \returns true if this is WEBP data, false otherwise.
+ * \returns true if this is XV data, false otherwise.
  *
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_isANI
  * \sa IMG_isAVIF
- * \sa IMG_isICO
- * \sa IMG_isCUR
  * \sa IMG_isBMP
+ * \sa IMG_isCUR
  * \sa IMG_isGIF
+ * \sa IMG_isICO
  * \sa IMG_isJPG
  * \sa IMG_isJXL
  * \sa IMG_isLBM
  * \sa IMG_isPCX
  * \sa IMG_isPNG
  * \sa IMG_isPNM
- * \sa IMG_isSVG
  * \sa IMG_isQOI
+ * \sa IMG_isSVG
  * \sa IMG_isTIF
+ * \sa IMG_isWEBP
  * \sa IMG_isXCF
  * \sa IMG_isXPM
- * \sa IMG_isXV
  */
-extern SDL_DECLSPEC bool SDLCALL IMG_isWEBP(SDL_IOStream *src);
+extern SDL_DECLSPEC bool SDLCALL IMG_isXV(SDL_IOStream *src);
 
 /**
  * Load a AVIF image directly.
@@ -1224,31 +1224,31 @@ extern SDL_DECLSPEC bool SDLCALL IMG_isWEBP(SDL_IOStream *src);
  *
  * \since This function is available since SDL_image 3.0.0.
  *
- * \sa IMG_LoadICO_IO
- * \sa IMG_LoadCUR_IO
  * \sa IMG_LoadBMP_IO
+ * \sa IMG_LoadCUR_IO
  * \sa IMG_LoadGIF_IO
+ * \sa IMG_LoadICO_IO
  * \sa IMG_LoadJPG_IO
  * \sa IMG_LoadJXL_IO
  * \sa IMG_LoadLBM_IO
  * \sa IMG_LoadPCX_IO
  * \sa IMG_LoadPNG_IO
  * \sa IMG_LoadPNM_IO
- * \sa IMG_LoadSVG_IO
  * \sa IMG_LoadQOI_IO
+ * \sa IMG_LoadSVG_IO
  * \sa IMG_LoadTGA_IO
  * \sa IMG_LoadTIF_IO
+ * \sa IMG_LoadWEBP_IO
  * \sa IMG_LoadXCF_IO
  * \sa IMG_LoadXPM_IO
  * \sa IMG_LoadXV_IO
- * \sa IMG_LoadWEBP_IO
  */
 extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadAVIF_IO(SDL_IOStream *src);
 
 /**
- * Load a ICO image directly.
+ * Load a BMP image directly.
  *
- * If you know you definitely have a ICO image, you can call this function,
+ * If you know you definitely have a BMP image, you can call this function,
  * which will skip SDL_image's file format detection routines. Generally it's
  * better to use the abstract interfaces; also, there is only an SDL_IOStream
  * interface available here.
@@ -1260,24 +1260,24 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadAVIF_IO(SDL_IOStream *src);
  *
  * \sa IMG_LoadAVIF_IO
  * \sa IMG_LoadCUR_IO
- * \sa IMG_LoadBMP_IO
  * \sa IMG_LoadGIF_IO
+ * \sa IMG_LoadICO_IO
  * \sa IMG_LoadJPG_IO
  * \sa IMG_LoadJXL_IO
  * \sa IMG_LoadLBM_IO
  * \sa IMG_LoadPCX_IO
  * \sa IMG_LoadPNG_IO
  * \sa IMG_LoadPNM_IO
- * \sa IMG_LoadSVG_IO
  * \sa IMG_LoadQOI_IO
+ * \sa IMG_LoadSVG_IO
  * \sa IMG_LoadTGA_IO
  * \sa IMG_LoadTIF_IO
+ * \sa IMG_LoadWEBP_IO
  * \sa IMG_LoadXCF_IO
  * \sa IMG_LoadXPM_IO
  * \sa IMG_LoadXV_IO
- * \sa IMG_LoadWEBP_IO
  */
-extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadICO_IO(SDL_IOStream *src);
+extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadBMP_IO(SDL_IOStream *src);
 
 /**
  * Load a CUR image directly.
@@ -1293,30 +1293,30 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadICO_IO(SDL_IOStream *src);
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_LoadAVIF_IO
- * \sa IMG_LoadICO_IO
  * \sa IMG_LoadBMP_IO
  * \sa IMG_LoadGIF_IO
+ * \sa IMG_LoadICO_IO
  * \sa IMG_LoadJPG_IO
  * \sa IMG_LoadJXL_IO
  * \sa IMG_LoadLBM_IO
  * \sa IMG_LoadPCX_IO
  * \sa IMG_LoadPNG_IO
  * \sa IMG_LoadPNM_IO
- * \sa IMG_LoadSVG_IO
  * \sa IMG_LoadQOI_IO
+ * \sa IMG_LoadSVG_IO
  * \sa IMG_LoadTGA_IO
  * \sa IMG_LoadTIF_IO
+ * \sa IMG_LoadWEBP_IO
  * \sa IMG_LoadXCF_IO
  * \sa IMG_LoadXPM_IO
  * \sa IMG_LoadXV_IO
- * \sa IMG_LoadWEBP_IO
  */
 extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadCUR_IO(SDL_IOStream *src);
 
 /**
- * Load a BMP image directly.
+ * Load a GIF image directly.
  *
- * If you know you definitely have a BMP image, you can call this function,
+ * If you know you definitely have a GIF image, you can call this function,
  * which will skip SDL_image's file format detection routines. Generally it's
  * better to use the abstract interfaces; also, there is only an SDL_IOStream
  * interface available here.
@@ -1327,30 +1327,30 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadCUR_IO(SDL_IOStream *src);
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_LoadAVIF_IO
- * \sa IMG_LoadICO_IO
+ * \sa IMG_LoadBMP_IO
  * \sa IMG_LoadCUR_IO
- * \sa IMG_LoadGIF_IO
+ * \sa IMG_LoadICO_IO
  * \sa IMG_LoadJPG_IO
  * \sa IMG_LoadJXL_IO
  * \sa IMG_LoadLBM_IO
  * \sa IMG_LoadPCX_IO
  * \sa IMG_LoadPNG_IO
  * \sa IMG_LoadPNM_IO
- * \sa IMG_LoadSVG_IO
  * \sa IMG_LoadQOI_IO
+ * \sa IMG_LoadSVG_IO
  * \sa IMG_LoadTGA_IO
  * \sa IMG_LoadTIF_IO
+ * \sa IMG_LoadWEBP_IO
  * \sa IMG_LoadXCF_IO
  * \sa IMG_LoadXPM_IO
  * \sa IMG_LoadXV_IO
- * \sa IMG_LoadWEBP_IO
  */
-extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadBMP_IO(SDL_IOStream *src);
+extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadGIF_IO(SDL_IOStream *src);
 
 /**
- * Load a GIF image directly.
+ * Load a ICO image directly.
  *
- * If you know you definitely have a GIF image, you can call this function,
+ * If you know you definitely have a ICO image, you can call this function,
  * which will skip SDL_image's file format detection routines. Generally it's
  * better to use the abstract interfaces; also, there is only an SDL_IOStream
  * interface available here.
@@ -1361,25 +1361,25 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL IMG_LoadBMP_IO(SDL_IOStream *src);
  * \since This function is available since SDL_image 3.0.0.
  *
  * \sa IMG_LoadAVIF_IO
- * \sa IMG_LoadICO_IO
- * \sa IMG_LoadCUR_IO
  * \sa IMG_LoadBMP_IO
+ * \sa IMG_LoadCUR_IO
+ * \sa IMG_LoadGIF_IO
  * \sa IMG_LoadJPG_IO
  * \sa IMG_LoadJXL_IO
  * \sa IMG_LoadLBM_IO
  * \sa IMG_LoadPCX_IO
  * \sa IMG_LoadPNG_IO
  * \sa IMG_

(Patch may be truncated, please check the link at the top of this post.)