Skip to content

Commit ba1d99d

Browse files
committed
fix up return type of copy_mem
more consistent with the other funcs now
1 parent f78e9e4 commit ba1d99d

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

tests/034.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ can copy to memory
66
<?php
77
$filename = dirname(__FILE__) . "/images/img_0076.jpg";
88
$image1 = vips_image_new_from_file($filename)["out"];
9-
$image2 = vips_image_copy_memory($image1);
9+
$image2 = vips_image_copy_memory($image1)["out"];
1010

1111
$avg1 = vips_call("avg", $image1)["out"];
1212
$avg2 = vips_call("avg", $image2)["out"];

vips-1.0.6.tgz

18 Bytes
Binary file not shown.

vips.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,15 +1338,8 @@ PHP_FUNCTION(vips_image_copy_memory)
13381338
zval *IM;
13391339
VipsImage *image;
13401340
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;
13501343

13511344
VIPS_DEBUG_MSG("vips_image_copy_memory:\n");
13521345

@@ -1364,7 +1357,12 @@ PHP_FUNCTION(vips_image_copy_memory)
13641357
RETURN_LONG(-1);
13651358
}
13661359

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);
13681366
}
13691367
/* }}} */
13701368

0 commit comments

Comments
 (0)