---
name: "im_setupout"
section: "3"
platform: "linux"
package: "libvips-dev"
version: "7.20.7-1+b3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/im_setupout"
---

# im\_setupout(3)

set up an image descriptor for WIO output

## NAME

im\_setupout - set up an image descriptor for WIO output

## SYNOPSIS

**#include \<vips/vips.h\>**

**int im\_setupout(image)**\
 **IMAGE \*image;**

## DESCRIPTION

**[im\_setupout(3)](/im_setupout/3.md)** makes a descriptor ready for WIO writing. If the descriptor is a memory buffer, enough memory is allocated to be able to hold all of the pels of the image. If the descriptor is an output file, then the header is written to disc.

Typically, for WIO, you should have

    int\
     im\_wombat( in, out )\
     IMAGE \*in, \*out;\
     {\
         if( im\_iocheck( in, out ) )\
             return( -1 );

        ... check parameters, check image descriptors \
         ... for type-compatibility, etc. etc.

        if( im\_cp\_desc( out, in ) )\
             return( -1 );

        ... set fields in out for the type of image you\
         ... wish to write

        if( im\_setupout( out ) )\
             return( -1 );

        ... process from input to output, reading from in-\>data\
 	... and writing to out with [im\_writeline(3)](/im_writeline/3.md)

        return( 0 );\
     }

## RETURN VALUE

The function returns 0 on success and -1 on error.

## SEE ALSO

[im\_cp\_desc(3)](/im_cp_desc/3.md), [im\_iocheck(3)](/im_iocheck/3.md).

## COPYRIGHT

N. Dessipris

## AUTHOR

N. Dessipris - 11/04/1990, updated on 22/04/1991
