@@ -1397,6 +1397,34 @@ PHP_FUNCTION(vips_image_set)
1397
1397
}
1398
1398
/* }}} */
1399
1399
1400
+ /* {{{ proto long vips_image_remove(resource image, string field)
1401
+ Remove field from image */
1402
+ PHP_FUNCTION (vips_image_remove )
1403
+ {
1404
+ zval * im ;
1405
+ char * field_name ;
1406
+ size_t field_name_len ;
1407
+ VipsImage * image ;
1408
+ GType type ;
1409
+
1410
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "rs" ,
1411
+ & im , & field_name , & field_name_len ) == FAILURE ) {
1412
+ RETURN_LONG (-1 );
1413
+ }
1414
+
1415
+ if ((image = (VipsImage * )zend_fetch_resource (Z_RES_P (im ),
1416
+ "GObject" , le_gobject )) == NULL ) {
1417
+ RETURN_LONG (-1 );
1418
+ }
1419
+
1420
+ if (!vips_image_remove (image , field_name )) {
1421
+ RETURN_LONG (-1 );
1422
+ }
1423
+
1424
+ RETURN_LONG (0 );
1425
+ }
1426
+ /* }}} */
1427
+
1400
1428
/* {{{ proto string vips_error_buffer()
1401
1429
Fetch and clear the vips error buffer */
1402
1430
PHP_FUNCTION (vips_error_buffer )
@@ -1552,6 +1580,11 @@ ZEND_BEGIN_ARG_INFO(arginfo_vips_image_set, 0)
1552
1580
ZEND_ARG_INFO (0 , value )
1553
1581
ZEND_END_ARG_INFO ()
1554
1582
1583
+ ZEND_BEGIN_ARG_INFO (arginfo_vips_image_remove , 0 )
1584
+ ZEND_ARG_INFO (0 , image )
1585
+ ZEND_ARG_INFO (0 , field )
1586
+ ZEND_END_ARG_INFO ()
1587
+
1555
1588
ZEND_BEGIN_ARG_INFO (arginfo_vips_error_buffer , 0 )
1556
1589
ZEND_END_ARG_INFO ()
1557
1590
@@ -1569,6 +1602,7 @@ const zend_function_entry vips_functions[] = {
1569
1602
PHP_FE (vips_image_get , arginfo_vips_image_get )
1570
1603
PHP_FE (vips_image_get_typeof , arginfo_vips_image_get_typeof )
1571
1604
PHP_FE (vips_image_set , arginfo_vips_image_set )
1605
+ PHP_FE (vips_image_remove , arginfo_vips_image_remove )
1572
1606
PHP_FE (vips_error_buffer , arginfo_vips_error_buffer )
1573
1607
1574
1608
PHP_FE_END /* Must be the last line in vips_functions[] */
0 commit comments