@@ -885,6 +885,11 @@ ZEND_BEGIN_ARG_INFO(arginfo_imageantialias, 0)
885
885
ZEND_ARG_INFO (0 , im )
886
886
ZEND_ARG_INFO (0 , on )
887
887
ZEND_END_ARG_INFO ()
888
+
889
+ ZEND_BEGIN_ARG_INFO (arginfo_imageflip , 0 )
890
+ ZEND_ARG_INFO (0 , im )
891
+ ZEND_ARG_INFO (0 , mode )
892
+ ZEND_END_ARG_INFO ()
888
893
#endif
889
894
890
895
/* }}} */
@@ -944,6 +949,7 @@ const zend_function_entry gd_functions[] = {
944
949
945
950
#ifdef HAVE_GD_BUNDLED
946
951
PHP_FE (imageantialias , arginfo_imageantialias )
952
+ PHP_FE (imageflip , arginfo_imageflip )
947
953
#endif
948
954
949
955
#if HAVE_GD_IMAGESETTILE
@@ -5041,15 +5047,15 @@ PHP_FUNCTION(imageconvolution)
5041
5047
if (zend_hash_index_find (Z_ARRVAL_PP (var ), (j ), (void * * ) & var2 ) == SUCCESS ) {
5042
5048
SEPARATE_ZVAL (var2 );
5043
5049
convert_to_double (* var2 );
5044
- matrix [i ][j ] = Z_DVAL_PP (var2 );
5050
+ matrix [i ][j ] = ( float ) Z_DVAL_PP (var2 );
5045
5051
} else {
5046
5052
php_error_docref (NULL TSRMLS_CC , E_WARNING , "You must have a 3x3 matrix" );
5047
5053
RETURN_FALSE ;
5048
5054
}
5049
5055
}
5050
5056
}
5051
5057
}
5052
- res = gdImageConvolution (im_src , matrix , div , offset );
5058
+ res = gdImageConvolution (im_src , matrix , ( float ) div , ( float ) offset );
5053
5059
5054
5060
if (res ) {
5055
5061
RETURN_TRUE ;
@@ -5078,8 +5084,46 @@ PHP_FUNCTION(imageantialias)
5078
5084
RETURN_TRUE ;
5079
5085
}
5080
5086
/* }}} */
5087
+
5088
+
5089
+ /* {{{ proto void imageflip(resource im, int mode)
5090
+ Flip an image (in place) horizontally, vertically or both directions. */
5091
+ PHP_FUNCTION (imageflip )
5092
+ {
5093
+ zval * IM ;
5094
+ long mode ;
5095
+ gdImagePtr im ;
5096
+
5097
+ if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "rl" , & IM , & mode ) == FAILURE ) {
5098
+ return ;
5099
+ }
5100
+
5101
+ ZEND_FETCH_RESOURCE (im , gdImagePtr , & IM , -1 , "Image" , le_gd );
5102
+
5103
+ switch (mode ) {
5104
+ case GD_FLIP_VERTICAL :
5105
+ gdImageFlipHorizontal (im );
5106
+ break ;
5107
+
5108
+ case GD_FLIP_HORINZONTAL :
5109
+ gdImageFlipVertical (im );
5110
+ break ;
5111
+
5112
+ case GD_FLIP_BOTH :
5113
+ gdImageFlipBoth (im );
5114
+ break ;
5115
+
5116
+ default :
5117
+ php_error_docref (NULL TSRMLS_CC , E_WARNING , "Unknown flip mode ");
5118
+ RETURN_FALSE ;
5119
+ }
5120
+
5121
+ RETURN_TRUE ;
5122
+ }
5123
+ /* }}} */
5081
5124
#endif
5082
5125
5126
+
5083
5127
/*
5084
5128
* Local variables:
5085
5129
* tab-width: 4
0 commit comments