im_close(3) close an image descriptor


#include <vips/vips.h>

int im_close(image)
IMAGE *image;


im_close(3) frees all the resources attached to the image descriptor. This may involve closing files, freeing memory buffers, triggering close callback lists, unmapping files, freeing regions, and so on. If all this succeeds, then the function returns zero. If something goes wrong, the function returns non-zero and sets im_errormsg(3). If im_close(3) fails, the image descriptor is left in an undefined state.

In the case that the image descriptor corresponds to a file opened by im_openout(3) that has been written to, the function sets an output description file as follows: If the output image filename is terminated with ".v", the string held by the Hist member of the image descriptor is copied to a corresponding file ending with ".desc" in the same directory. In all other cases, an output .desc file is not created.

If a NULL pointer is passed to im_close(3), it returns successfully immediately.


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


N. Dessipris, K. Martinez, J. Cupitt


N. Dessipris - 11/04/1990