@@ -105,11 +105,11 @@ function image_type_to_extension(int $image_type, bool $include_dot = true): str
105
105
* such as imagecreatetruecolor.
106
106
* @param array $affine Array with keys 0 to 5.
107
107
* @param array $clip Array with keys "x", "y", "width" and "height"; or NULL.
108
- * @return resource Return affined image object on success.
108
+ * @return \GdImage Return affined image object on success.
109
109
* @throws ImageException
110
110
*
111
111
*/
112
- function imageaffine (\GdImage $ image , array $ affine , ?array $ clip = null )
112
+ function imageaffine (\GdImage $ image , array $ affine , ?array $ clip = null ): \ GdImage
113
113
{
114
114
error_clear_last ();
115
115
if ($ clip !== null ) {
@@ -727,11 +727,11 @@ function imagecopyresized(\GdImage $dst_image, \GdImage $src_image, int $dst_x,
727
727
*
728
728
* @param int $width The image width.
729
729
* @param int $height The image height.
730
- * @return resource Returns an image object on success.
730
+ * @return \GdImage Returns an image object on success.
731
731
* @throws ImageException
732
732
*
733
733
*/
734
- function imagecreate (int $ width , int $ height )
734
+ function imagecreate (int $ width , int $ height ): \ GdImage
735
735
{
736
736
error_clear_last ();
737
737
$ safeResult = \imagecreate ($ width , $ height );
@@ -767,11 +767,11 @@ function imagecreatefromavif(string $filename): \GdImage
767
767
* representing the image obtained from the given filename.
768
768
*
769
769
* @param string $filename Path to the BMP image.
770
- * @return resource Returns an image object on success.
770
+ * @return \GdImage Returns an image object on success.
771
771
* @throws ImageException
772
772
*
773
773
*/
774
- function imagecreatefrombmp (string $ filename )
774
+ function imagecreatefrombmp (string $ filename ): \ GdImage
775
775
{
776
776
error_clear_last ();
777
777
$ safeResult = \imagecreatefrombmp ($ filename );
@@ -786,11 +786,11 @@ function imagecreatefrombmp(string $filename)
786
786
* Create a new image from GD file or URL.
787
787
*
788
788
* @param string $filename Path to the GD file.
789
- * @return resource Returns an image object on success.
789
+ * @return \GdImage Returns an image object on success.
790
790
* @throws ImageException
791
791
*
792
792
*/
793
- function imagecreatefromgd (string $ filename )
793
+ function imagecreatefromgd (string $ filename ): \ GdImage
794
794
{
795
795
error_clear_last ();
796
796
$ safeResult = \imagecreatefromgd ($ filename );
@@ -805,11 +805,11 @@ function imagecreatefromgd(string $filename)
805
805
* Create a new image from GD2 file or URL.
806
806
*
807
807
* @param string $filename Path to the GD2 image.
808
- * @return resource Returns an image object on success.
808
+ * @return \GdImage Returns an image object on success.
809
809
* @throws ImageException
810
810
*
811
811
*/
812
- function imagecreatefromgd2 (string $ filename )
812
+ function imagecreatefromgd2 (string $ filename ): \ GdImage
813
813
{
814
814
error_clear_last ();
815
815
$ safeResult = \imagecreatefromgd2 ($ filename );
@@ -828,11 +828,11 @@ function imagecreatefromgd2(string $filename)
828
828
* @param int $y y-coordinate of source point.
829
829
* @param int $width Source width.
830
830
* @param int $height Source height.
831
- * @return resource Returns an image object on success.
831
+ * @return \GdImage Returns an image object on success.
832
832
* @throws ImageException
833
833
*
834
834
*/
835
- function imagecreatefromgd2part (string $ filename , int $ x , int $ y , int $ width , int $ height )
835
+ function imagecreatefromgd2part (string $ filename , int $ x , int $ y , int $ width , int $ height ): \ GdImage
836
836
{
837
837
error_clear_last ();
838
838
$ safeResult = \imagecreatefromgd2part ($ filename , $ x , $ y , $ width , $ height );
@@ -848,11 +848,11 @@ function imagecreatefromgd2part(string $filename, int $x, int $y, int $width, in
848
848
* representing the image obtained from the given filename.
849
849
*
850
850
* @param string $filename Path to the GIF image.
851
- * @return resource Returns an image object on success.
851
+ * @return \GdImage Returns an image object on success.
852
852
* @throws ImageException
853
853
*
854
854
*/
855
- function imagecreatefromgif (string $ filename )
855
+ function imagecreatefromgif (string $ filename ): \ GdImage
856
856
{
857
857
error_clear_last ();
858
858
$ safeResult = \imagecreatefromgif ($ filename );
@@ -868,11 +868,11 @@ function imagecreatefromgif(string $filename)
868
868
* representing the image obtained from the given filename.
869
869
*
870
870
* @param string $filename Path to the JPEG image.
871
- * @return resource Returns an image object on success.
871
+ * @return \GdImage Returns an image object on success.
872
872
* @throws ImageException
873
873
*
874
874
*/
875
- function imagecreatefromjpeg (string $ filename )
875
+ function imagecreatefromjpeg (string $ filename ): \ GdImage
876
876
{
877
877
error_clear_last ();
878
878
$ safeResult = \imagecreatefromjpeg ($ filename );
@@ -888,11 +888,11 @@ function imagecreatefromjpeg(string $filename)
888
888
* representing the image obtained from the given filename.
889
889
*
890
890
* @param string $filename Path to the PNG image.
891
- * @return resource Returns an image object on success.
891
+ * @return \GdImage Returns an image object on success.
892
892
* @throws ImageException
893
893
*
894
894
*/
895
- function imagecreatefrompng (string $ filename )
895
+ function imagecreatefrompng (string $ filename ): \ GdImage
896
896
{
897
897
error_clear_last ();
898
898
$ safeResult = \imagecreatefrompng ($ filename );
@@ -910,13 +910,13 @@ function imagecreatefrompng(string $filename)
910
910
* them: JPEG, PNG, GIF, BMP, WBMP, GD2, and WEBP.
911
911
*
912
912
* @param string $data A string containing the image data.
913
- * @return resource An image object will be returned on success. FALSE is returned if
913
+ * @return \GdImage An image object will be returned on success. FALSE is returned if
914
914
* the image type is unsupported, the data is not in a recognised format,
915
915
* or the image is corrupt and cannot be loaded.
916
916
* @throws ImageException
917
917
*
918
918
*/
919
- function imagecreatefromstring (string $ data )
919
+ function imagecreatefromstring (string $ data ): \ GdImage
920
920
{
921
921
error_clear_last ();
922
922
$ safeResult = \imagecreatefromstring ($ data );
@@ -952,11 +952,11 @@ function imagecreatefromtga(string $filename): \GdImage
952
952
* representing the image obtained from the given filename.
953
953
*
954
954
* @param string $filename Path to the WBMP image.
955
- * @return resource Returns an image object on success.
955
+ * @return \GdImage Returns an image object on success.
956
956
* @throws ImageException
957
957
*
958
958
*/
959
- function imagecreatefromwbmp (string $ filename )
959
+ function imagecreatefromwbmp (string $ filename ): \ GdImage
960
960
{
961
961
error_clear_last ();
962
962
$ safeResult = \imagecreatefromwbmp ($ filename );
@@ -972,11 +972,11 @@ function imagecreatefromwbmp(string $filename)
972
972
* representing the image obtained from the given filename.
973
973
*
974
974
* @param string $filename Path to the WebP image.
975
- * @return resource Returns an image object on success.
975
+ * @return \GdImage Returns an image object on success.
976
976
* @throws ImageException
977
977
*
978
978
*/
979
- function imagecreatefromwebp (string $ filename )
979
+ function imagecreatefromwebp (string $ filename ): \ GdImage
980
980
{
981
981
error_clear_last ();
982
982
$ safeResult = \imagecreatefromwebp ($ filename );
@@ -992,11 +992,11 @@ function imagecreatefromwebp(string $filename)
992
992
* representing the image obtained from the given filename.
993
993
*
994
994
* @param string $filename Path to the XBM image.
995
- * @return resource Returns an image object on success.
995
+ * @return \GdImage Returns an image object on success.
996
996
* @throws ImageException
997
997
*
998
998
*/
999
- function imagecreatefromxbm (string $ filename )
999
+ function imagecreatefromxbm (string $ filename ): \ GdImage
1000
1000
{
1001
1001
error_clear_last ();
1002
1002
$ safeResult = \imagecreatefromxbm ($ filename );
@@ -1012,11 +1012,11 @@ function imagecreatefromxbm(string $filename)
1012
1012
* representing the image obtained from the given filename.
1013
1013
*
1014
1014
* @param string $filename Path to the XPM image.
1015
- * @return resource Returns an image object on success.
1015
+ * @return \GdImage Returns an image object on success.
1016
1016
* @throws ImageException
1017
1017
*
1018
1018
*/
1019
- function imagecreatefromxpm (string $ filename )
1019
+ function imagecreatefromxpm (string $ filename ): \ GdImage
1020
1020
{
1021
1021
error_clear_last ();
1022
1022
$ safeResult = \imagecreatefromxpm ($ filename );
@@ -1033,11 +1033,11 @@ function imagecreatefromxpm(string $filename)
1033
1033
*
1034
1034
* @param int $width Image width.
1035
1035
* @param int $height Image height.
1036
- * @return resource Returns an image object on success.
1036
+ * @return \GdImage Returns an image object on success.
1037
1037
* @throws ImageException
1038
1038
*
1039
1039
*/
1040
- function imagecreatetruecolor (int $ width , int $ height )
1040
+ function imagecreatetruecolor (int $ width , int $ height ): \ GdImage
1041
1041
{
1042
1042
error_clear_last ();
1043
1043
$ safeResult = \imagecreatetruecolor ($ width , $ height );
@@ -1057,11 +1057,11 @@ function imagecreatetruecolor(int $width, int $height)
1057
1057
* @param array $rectangle The cropping rectangle as array with keys
1058
1058
* x, y, width and
1059
1059
* height.
1060
- * @return resource Return cropped image object on success.
1060
+ * @return \GdImage Return cropped image object on success.
1061
1061
* @throws ImageException
1062
1062
*
1063
1063
*/
1064
- function imagecrop (\GdImage $ image , array $ rectangle )
1064
+ function imagecrop (\GdImage $ image , array $ rectangle ): \ GdImage
1065
1065
{
1066
1066
error_clear_last ();
1067
1067
$ safeResult = \imagecrop ($ image , $ rectangle );
@@ -1081,12 +1081,12 @@ function imagecrop(\GdImage $image, array $rectangle)
1081
1081
* @param int $mode One of the following constants:
1082
1082
* @param float $threshold
1083
1083
* @param int $color
1084
- * @return resource Returns a cropped image object on success.
1084
+ * @return \GdImage Returns a cropped image object on success.
1085
1085
* If the complete image was cropped, imagecrop returns FALSE.
1086
1086
* @throws ImageException
1087
1087
*
1088
1088
*/
1089
- function imagecropauto (\GdImage $ image , int $ mode = IMG_CROP_DEFAULT , float $ threshold = 0.5 , int $ color = -1 )
1089
+ function imagecropauto (\GdImage $ image , int $ mode = IMG_CROP_DEFAULT , float $ threshold = 0.5 , int $ color = -1 ): \ GdImage
1090
1090
{
1091
1091
error_clear_last ();
1092
1092
$ safeResult = \imagecropauto ($ image , $ mode , $ threshold , $ color );
@@ -1824,11 +1824,11 @@ function imagegif(\GdImage $image, $file = null): void
1824
1824
/**
1825
1825
* Grabs a screenshot of the whole screen.
1826
1826
*
1827
- * @return resource Returns an image object on success.
1827
+ * @return \GdImage Returns an image object on success.
1828
1828
* @throws ImageException
1829
1829
*
1830
1830
*/
1831
- function imagegrabscreen ()
1831
+ function imagegrabscreen (): \ GdImage
1832
1832
{
1833
1833
error_clear_last ();
1834
1834
$ safeResult = \imagegrabscreen ();
@@ -2163,11 +2163,11 @@ function imageresolution(\GdImage $image, ?int $resolution_x = null, ?int $resol
2163
2163
* number of degrees to rotate the image anticlockwise.
2164
2164
* @param int $background_color Specifies the color of the uncovered zone after the rotation
2165
2165
* @param bool $ignore_transparent This parameter is unused.
2166
- * @return resource Returns an image object for the rotated image.
2166
+ * @return \GdImage Returns an image object for the rotated image.
2167
2167
* @throws ImageException
2168
2168
*
2169
2169
*/
2170
- function imagerotate (\GdImage $ image , float $ angle , int $ background_color , bool $ ignore_transparent = false )
2170
+ function imagerotate (\GdImage $ image , float $ angle , int $ background_color , bool $ ignore_transparent = false ): \ GdImage
2171
2171
{
2172
2172
error_clear_last ();
2173
2173
$ safeResult = \imagerotate ($ image , $ angle , $ background_color , $ ignore_transparent );
@@ -2221,11 +2221,11 @@ function imagesavealpha(\GdImage $image, bool $enable): void
2221
2221
* IMG_WEIGHTED4 is not yet supported.
2222
2222
*
2223
2223
*
2224
- * @return resource Return the scaled image object on success.
2224
+ * @return \GdImage Return the scaled image object on success.
2225
2225
* @throws ImageException
2226
2226
*
2227
2227
*/
2228
- function imagescale (\GdImage $ image , int $ width , int $ height = -1 , int $ mode = IMG_BILINEAR_FIXED )
2228
+ function imagescale (\GdImage $ image , int $ width , int $ height = -1 , int $ mode = IMG_BILINEAR_FIXED ): \ GdImage
2229
2229
{
2230
2230
error_clear_last ();
2231
2231
$ safeResult = \imagescale ($ image , $ width , $ height , $ mode );
0 commit comments