summaryrefslogtreecommitdiff
path: root/ext/gd/gd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/gd.c')
-rw-r--r--ext/gd/gd.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 958495c..22879ae 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1208,23 +1208,19 @@ PHP_FUNCTION(imagecopyresampled)
Rotate an image using a custom angle */
PHP_FUNCTION(imagerotate)
{
- zval **SIM, **ANGLE, **BGDCOLOR;
+ zval *SIM;
gdImagePtr im_dst, im_src;
double degrees;
long color;
+ long ignoretransparent = 0;
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &SIM, &ANGLE, &BGDCOLOR) == FAILURE) {
- ZEND_WRONG_PARAM_COUNT();
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdl|l", &SIM, &degrees, &color, &ignoretransparent) == FAILURE) {
+ RETURN_FALSE;
}
- ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd);
-
- convert_to_long_ex(BGDCOLOR);
- color = Z_LVAL_PP(BGDCOLOR);
+ ZEND_FETCH_RESOURCE(im_src, gdImagePtr, &SIM, -1, "Image", le_gd);
- convert_to_double_ex(ANGLE);
- degrees = Z_DVAL_PP(ANGLE);
- im_dst = gdImageRotate(im_src, degrees, color);
+ im_dst = gdImageRotate(im_src, degrees, color, ignoretransparent);
if (im_dst != NULL) {
ZEND_REGISTER_RESOURCE(return_value, im_dst, le_gd);