@@ -3814,29 +3814,29 @@ PHP_FUNCTION(imagecrop)
3814
3814
if ((tmp = zend_hash_str_find (Z_ARRVAL_P (z_rect ), "x" , sizeof ("x" ) - 1 )) != NULL ) {
3815
3815
rect .x = zval_get_long (tmp );
3816
3816
} else {
3817
- php_error_docref (NULL , E_WARNING , "Missing x position" );
3818
- RETURN_FALSE ;
3817
+ zend_throw_error (NULL , "Cropping rectangle is missing x position" );
3818
+ return ;
3819
3819
}
3820
3820
3821
3821
if ((tmp = zend_hash_str_find (Z_ARRVAL_P (z_rect ), "y" , sizeof ("y" ) - 1 )) != NULL ) {
3822
3822
rect .y = zval_get_long (tmp );
3823
3823
} else {
3824
- php_error_docref (NULL , E_WARNING , "Missing y position" );
3825
- RETURN_FALSE ;
3824
+ zend_throw_error (NULL , "Cropping rectangle is missing y position" );
3825
+ return ;
3826
3826
}
3827
3827
3828
3828
if ((tmp = zend_hash_str_find (Z_ARRVAL_P (z_rect ), "width" , sizeof ("width" ) - 1 )) != NULL ) {
3829
3829
rect .width = zval_get_long (tmp );
3830
3830
} else {
3831
- php_error_docref (NULL , E_WARNING , "Missing width" );
3832
- RETURN_FALSE ;
3831
+ zend_throw_error (NULL , "Cropping rectangle is missing width" );
3832
+ return ;
3833
3833
}
3834
3834
3835
3835
if ((tmp = zend_hash_str_find (Z_ARRVAL_P (z_rect ), "height" , sizeof ("height" ) - 1 )) != NULL ) {
3836
3836
rect .height = zval_get_long (tmp );
3837
3837
} else {
3838
- php_error_docref (NULL , E_WARNING , "Missing height" );
3839
- RETURN_FALSE ;
3838
+ zend_throw_error (NULL , "Cropping rectangle is missing height" );
3839
+ return ;
3840
3840
}
3841
3841
3842
3842
im_crop = gdImageCrop (im , & rect );
@@ -3879,16 +3879,17 @@ PHP_FUNCTION(imagecropauto)
3879
3879
3880
3880
case GD_CROP_THRESHOLD :
3881
3881
if (color < 0 || (!gdImageTrueColor (im ) && color >= gdImageColorsTotal (im ))) {
3882
- php_error_docref (NULL , E_WARNING , "Color argument missing with threshold mode" );
3883
- RETURN_FALSE ;
3882
+ zend_throw_error (NULL , "Color argument missing with threshold mode" );
3883
+ return ;
3884
3884
}
3885
3885
im_crop = gdImageCropThreshold (im , color , (float ) threshold );
3886
3886
break ;
3887
3887
3888
3888
default :
3889
- php_error_docref (NULL , E_WARNING , "Unknown crop mode" );
3890
- RETURN_FALSE ;
3889
+ zend_throw_error (NULL , "Unknown crop mode" );
3890
+ return ;
3891
3891
}
3892
+
3892
3893
if (im_crop == NULL ) {
3893
3894
RETURN_FALSE ;
3894
3895
} else {
0 commit comments