---
name: "IMG_isXPM"
section: "3"
platform: "linux"
package: "libsdl3-image-doc"
version: "3.2.4+ds-1+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/IMG_isXPM"
---

# IMG\_isXPM(3)

Detect XPM image data on a readable/seekable SDL\_IOStream.

## NAME

IMG\_isXPM - Detect XPM image data on a readable/seekable SDL\_IOStream.

## HEADER FILE

Defined in SDL3\_image/SDL\_image.h

## SYNOPSIS

```
#include "SDL3_image/SDL_image.h"
```

**bool IMG\_isXPM(SDL\_IOStream \*src);**

## DESCRIPTION

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).

There is no distinction made between "not the filetype in question" and basic i/o errors.

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.

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.

## FUNCTION PARAMETERS

- *src*

  a seekable/readable SDL\_IOStream to provide image data.

## RETURN VALUE

Returns non-zero if this is XPM data, zero otherwise.

## AVAILABILITY

This function is available since SDL\_image 3.0.0.

## SEE ALSO

**•**(3), [**IMG\_isAVIF**(3)](/IMG_isAVIF/3.md), **•**(3), [**IMG\_isICO**(3)](/IMG_isICO/3.md), **•**(3), [**IMG\_isCUR**(3)](/IMG_isCUR/3.md), **•**(3), [**IMG\_isBMP**(3)](/IMG_isBMP/3.md), **•**(3), [**IMG\_isGIF**(3)](/IMG_isGIF/3.md), **•**(3), [**IMG\_isJPG**(3)](/IMG_isJPG/3.md), **•**(3), [**IMG\_isJXL**(3)](/IMG_isJXL/3.md), **•**(3), [**IMG\_isLBM**(3)](/IMG_isLBM/3.md), **•**(3), [**IMG\_isPCX**(3)](/IMG_isPCX/3.md), **•**(3), [**IMG\_isPNG**(3)](/IMG_isPNG/3.md), **•**(3), [**IMG\_isPNM**(3)](/IMG_isPNM/3.md), **•**(3), [**IMG\_isSVG**(3)](/IMG_isSVG/3.md), **•**(3), [**IMG\_isQOI**(3)](/IMG_isQOI/3.md), **•**(3), [**IMG\_isTIF**(3)](/IMG_isTIF/3.md), **•**(3), [**IMG\_isXCF**(3)](/IMG_isXCF/3.md), **•**(3), [**IMG\_isXV**(3)](/IMG_isXV/3.md), **•**(3), [**IMG\_isWEBP**(3)](/IMG_isWEBP/3.md)
