diff --git a/cplusplus/VImage.cpp b/cplusplus/VImage.cpp index e2a060e99..b1961722a 100644 --- a/cplusplus/VImage.cpp +++ b/cplusplus/VImage.cpp @@ -647,7 +647,7 @@ VImage::new_from_memory_steal(const void *data, size_t size, throw(VError()); g_signal_connect(image, "postclose", - G_CALLBACK(vips_image_free_buffer), (void *) data); + G_CALLBACK(vips_image_free_buffer), const_cast(data)); return VImage(image); } @@ -1594,6 +1594,14 @@ operator>>=(VImage &a, const std::vector b) // Compat operations +VImage +VImage::new_from_memory_steal(void *data, size_t size, + int width, int height, int bands, VipsBandFormat format) +{ + return new_from_memory_steal(static_cast(data), size, + width, height, bands, format); +} + void VImage::rawsave_fd(int fd, VOption *options) const { diff --git a/cplusplus/include/vips/VImage8.h b/cplusplus/include/vips/VImage8.h index f58f9278c..4d61d9b16 100644 --- a/cplusplus/include/vips/VImage8.h +++ b/cplusplus/include/vips/VImage8.h @@ -2050,6 +2050,10 @@ class VImage : public VObject { // Compat operations + static VImage + new_from_memory_steal(void *data, size_t size, + int width, int height, int bands, VipsBandFormat format); + /** * Write raw image to file descriptor. *