IMG_isBMP(3)
okay so bestie, welcome to IMG_isBMP(3) from the SDL_image3 FUNCTIONS crew β it's the tiny vibe check that tells you if some data is giving BMP energy. π¦
π NAME π
IMG_isBMP β detect BMP image data on a readable/seekable SDL_IOStream. periodt. β¨
β¨ SYNOPSIS β¨
#include <SDL3_image/SDL_image.h>
bool IMG_isBMP(SDL_IOStream *src);
πΈ DESCRIPTION πΈ
okay so this function literally attempts to determine if a file is a given filetype, and it reads the least amount possible from the SDL_IOStream (usually just a few bytes). lowkey efficient, highkey iconic. π
bestie, there is no distinction made between "not the filetype in question" and basic i/o errors β it's giving mystery, and not in a fun way. π
this function will always attempt to seek src back to where it started when this function was called, but it will not report any errors in doing so. but assuming seeking works, this means you can immediately use this with a different IMG_isTYPE function, or load the image without further seeking. no extra seek drama, we love to see it. π«Ά
you do not need to call this function to load data; SDL_image can work to determine file type in many cases in its standard load functions. so this is more like a lil pre-game vibe check, not a mandatory step. π
π«Ά FUNCTION PARAMETERS π«Ά
srcβ a seekable/readableSDL_IOStreamto provide image data. π«Ά
π RETURN VALUE π
Returns true if this is BMP data, false otherwise. that's it, that's the tea. π
π AVAILABILITY π
This function is available since SDL_image 3.0.0. slay. β¨
π SEE ALSO π
IMG_isANI(3)IMG_isAVIF(3)IMG_isCUR(3)IMG_isGIF(3)IMG_isICO(3)IMG_isJPG(3)IMG_isJXL(3)IMG_isLBM(3)IMG_isPCX(3)IMG_isPNG(3)IMG_isPNM(3)IMG_isQOI(3)IMG_isSVG(3)IMG_isTIF(3)IMG_isWEBP(3)IMG_isXCF(3)IMG_isXPM(3)IMG_isXV(3)
iykyk, go check the whole isTYPE family π
byeee bestie π β footer check: SDL_image, version SDL_image 3.4.4, page tag IMG_isBMP(3) (no date listed on this one, so no invented date, periodt). π
π¦ where this page comes from
- ubuntu stonking: libsdl3-image-doc 3.4.4+ds-2 Β· zlib/libpng AND HPND-like AND zlib-like-permissive
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms