---
name: "TIFFReadFromUserBuffer"
section: "3tiff"
platform: "linux"
package: "libtiff-dev"
version: "4.7.0-3+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/TIFFReadFromUserBuffer"
---

# TIFFReadFromUserBuffer(3tiff)

decode data using an user defined buffer

## NAME

TIFFReadFromUserBuffer - decode data using an user defined buffer

## SYNOPSIS

```
#include <tiffio.h>
```

- **int TIFFReadFromUserBuffer(TIFF \*tif, uint32\_t strile, void \*inbuf, tmsize\_t insize, void \*outbuf, tmsize\_t outsize)**

  ## DESCRIPTION

Use the provided input buffer (*inbuf*, *insize*) and decompress it into (*outbuf*, *outsize*). This function replaces the use of *TIFFReadEncodedStrip()* / *TIFFReadEncodedTile()* when the user can provide the buffer for the input data, for example when he wants to avoid **libtiff** to read the strile offset/count values from the **StripOffsets** / **StripByteCounts** or **TileOffsets** / **TileByteCounts** arrays. *inbuf* content must be writable (if bit reversal is needed).

## RETURN VALUES

Returns 1 in case of success, 0 otherwise.

## DIAGNOSTICS

All error messages are directed to the *TIFFErrorExtR()* routine.

## SEE ALSO

*TIFFOpen* (3tiff), *TIFFReadRawStrip* (3tiff), *TIFFReadScanline* (3tiff), *TIFFReadEncodedStrip* (3tiff), *TIFFReadEncodedTile* (3tiff), *libtiff* (3tiff),

## AUTHOR

LibTIFF contributors

## COPYRIGHT

1988-2022, LibTIFF contributors
