diff --git a/ChangeLog b/ChangeLog index e82cc29f..6cee415f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,8 @@ - dzsave can write compressed zips [Felix Bünemann] - vips_image_write() only refs the input when it has to ... makes it easier to combine many images in bounded memory +- VImage::write() implementation was missing +- VImage::write() return value changed from void to VImage to help chaining 18/5/16 started 8.3.2 - more robust vips image reading diff --git a/cplusplus/VImage.cpp b/cplusplus/VImage.cpp index a2d8101f..7f9d8187 100644 --- a/cplusplus/VImage.cpp +++ b/cplusplus/VImage.cpp @@ -2,6 +2,8 @@ * * 30/12/14 * - allow set enum value from string + * 10/6/16 + * - missing implementation of VImage::write() */ /* @@ -612,6 +614,15 @@ VImage::new_matrixv( int width, int height, ... ) return( matrix ); } +VImage +VImage::write( VImage out ) +{ + if( vips_image_write( this->get_image(), out.get_image() ) ) + throw VError(); + + return( out ); +} + void VImage::write_to_file( const char *name, VOption *options ) { diff --git a/cplusplus/include/vips/VImage8.h b/cplusplus/include/vips/VImage8.h index ca5116fc..c7f2ea3c 100644 --- a/cplusplus/include/vips/VImage8.h +++ b/cplusplus/include/vips/VImage8.h @@ -471,7 +471,7 @@ public: VImage new_from_image( std::vector pixel ); VImage new_from_image( double pixel ); - void write( VImage out ); + VImage write( VImage out ); void write_to_file( const char *name, VOption *options = 0 );