IMG_isWEBP(3)
π IMG_isWEBP(3) β like, the WEBP detector bestie π
okay so real quick: this is a page from SDL_image3 FUNCTIONS and the star of the show is IMG_isWEBP. yes she's a function. yes she's iconic. let's get into it β¨
π¦ NAME π¦
IMG_isWEBP β she peeks at a readable/seekable SDL_IOStream and is like "hmmβ¦ is this WEBP data?" and tells you. that's it. that's her whole job π
πΈ SYNOPSIS πΈ
#include <SDL3_image/SDL_image.h>
bool IMG_isWEBP(SDL_IOStream *src);
look at her. one param. one bool. main character energy fr fr π
π DESCRIPTION π
so basically this function attempts to determine if a file is a given filetype, and the way it does that is by reading the least amount possible from the SDL_IOStream β usually just a few bytes. lowkey respectful of your bandwidth ngl π«Ά
β οΈ important vibe check: there is no distinction made between "not the filetype in question" and basic i/o errors. like, she does NOT snitch on which one it was. both just come back as a no. π
also bestie, she will always attempt to seek src back to where it started when this function was called β but she will not report any errors in doing so. so assuming seeking works, this means you can immediately use this with a different IMG_isTYPE function, or load the image without further seeking. slay, rewinding queen π
and like β 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 she's convenient, not mandatory. she's giving β¨optional luxuryβ¨ not β¨mandatory homeworkβ¨
π FUNCTION PARAMETERS π
srcβ a seekable/readableSDL_IOStreamto provide image data. that's the snack she's inspecting π§
π RETURN VALUE π
Returns true if this is WEBP data, false otherwise. literally that simple, no cap π
β AVAILABILITY β
This function is available since SDL_image 3.0.0. been here since day one, an absolute veteran π
π SEE ALSO π
the whole isTYPE friend group, all of them, no one left out π:
IMG_isANI(3)IMG_isAVIF(3)IMG_isBMP(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_isXCF(3)IMG_isXPM(3)IMG_isXV(3)
okay that's the whole page!! mwah π go detect some webp files, bestie. this manual page comes to you courtesy of SDL_image, version SDL_image 3.4.4 β periodt, that's the source and the version, we stan a documented release ππ π¦
π¦ 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