/* Read a PNG file header into a VIPS header. */ static int png2vips_header( const char *name, IMAGE *out ) { Read *read; if( !(read = read_new( name, out )) ) return( -1 ); if( png2vips( read, 1 ) ) { read_destroy( read ); return( -1 ); } read_destroy( read ); return( 0 ); }
/** * im_png2vips: * @filename: file to load * @out: image to write to * * Read a PNG file into a VIPS image. It can read all png images, including 8- * and 16-bit images, 1 and 3 channel, with and without an alpha channel. * * There is no support for embedded ICC profiles. * * See also: #VipsFormat, im_vips2png(). * * Returns: 0 on success, -1 on error. */ int im_png2vips( const char *name, IMAGE *out ) { Read *read; #ifdef DEBUG printf( "im_png2vips: reading \"%s\"\n", name ); #endif /*DEBUG*/ if( !(read = read_new( name, out )) ) return( -1 ); if( png2vips( read, 0 ) ) { read_destroy( read ); return( -1 ); } read_destroy( read ); return( 0 ); }
/* By having a separate header func, we get lazy.c to open via disc/mem. */ static int im_png2vips_header( const char *name, IMAGE *out ) { return( png2vips( name, out, TRUE ) ); }
int im_png2vips( const char *name, IMAGE *out ) { return( png2vips( name, out, FALSE ) ); }