File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ can copy to memory
6
6
<?php
7
7
$ filename = dirname (__FILE__ ) . "/images/img_0076.jpg " ;
8
8
$ image1 = vips_image_new_from_file ($ filename )["out " ];
9
- $ image2 = vips_image_copy_memory ($ image1 );
9
+ $ image2 = vips_image_copy_memory ($ image1 )[ " out " ] ;
10
10
11
11
$ avg1 = vips_call ("avg " , $ image1 )["out " ];
12
12
$ avg2 = vips_call ("avg " , $ image2 )["out " ];
Original file line number Diff line number Diff line change @@ -1338,15 +1338,8 @@ PHP_FUNCTION(vips_image_copy_memory)
1338
1338
zval * IM ;
1339
1339
VipsImage * image ;
1340
1340
VipsImage * new_image ;
1341
-
1342
- char * name ;
1343
- size_t name_len ;
1344
- zval * options ;
1345
- char filename [VIPS_PATH_MAX ];
1346
- char option_string [VIPS_PATH_MAX ];
1347
- const char * operation_name ;
1348
- zval argv [2 ];
1349
- int argc ;
1341
+ zend_resource * resource ;
1342
+ zval zvalue ;
1350
1343
1351
1344
VIPS_DEBUG_MSG ("vips_image_copy_memory:\n" );
1352
1345
@@ -1364,7 +1357,12 @@ PHP_FUNCTION(vips_image_copy_memory)
1364
1357
RETURN_LONG (-1 );
1365
1358
}
1366
1359
1367
- RETURN_RES (zend_register_resource (new_image , le_gobject ));
1360
+ /* Return as an array for all OK, -1 for error.
1361
+ */
1362
+ array_init (return_value );
1363
+ resource = zend_register_resource (new_image , le_gobject );
1364
+ ZVAL_RES (& zvalue , resource );
1365
+ add_assoc_zval (return_value , "out" , & zvalue );
1368
1366
}
1369
1367
/* }}} */
1370
1368
You can’t perform that action at this time.
0 commit comments