### Method

# Vips Image write_prepare

#### Declaration [src]

    int
    vips_image_write_prepare (
      VipsImage* image
    )

#### Description [src]

Call this after setting header fields (width, height, and so on) to allocate resources ready for writing.

Normally this function is called for you by `vips_image_generate()` or `vips_image_write_line()`. You will need to call it yourself if you plan to write directly to the ->data member of a memory image.

#### Return value

Type: `int`

0 on success, or -1 on error.