From b5e1b169d6a6ca5e2d20d1de562f3ba9a70982be Mon Sep 17 00:00:00 2001 From: mowangjuanzi Date: Fri, 24 Jan 2025 01:30:43 +0800 Subject: [PATCH] Update image --- .../image/functions/imagefilledpolygon.xml | 5 +- .../image/functions/imagefilledrectangle.xml | 9 ++-- .../image/functions/imagefilltoborder.xml | 13 +++-- reference/image/functions/imagefilter.xml | 51 +++++++------------ reference/image/functions/imageftbbox.xml | 20 ++++---- reference/image/functions/imagefttext.xml | 20 ++++---- .../image/functions/imagegammacorrect.xml | 9 ++-- reference/image/functions/imagegd.xml | 18 +++---- reference/image/functions/imagegd2.xml | 18 +++---- reference/image/functions/imagegif.xml | 14 +---- reference/image/functions/imageinterlace.xml | 3 +- .../image/functions/imageistruecolor.xml | 11 ++-- reference/image/functions/imagejpeg.xml | 11 +--- .../image/functions/imagelayereffect.xml | 11 ++-- reference/image/functions/imageloadfont.xml | 11 ++-- .../image/functions/imagepalettecopy.xml | 20 ++++---- reference/image/functions/imagepng.xml | 3 +- 17 files changed, 95 insertions(+), 152 deletions(-) diff --git a/reference/image/functions/imagefilledpolygon.xml b/reference/image/functions/imagefilledpolygon.xml index 251985557..bacf5e80a 100644 --- a/reference/image/functions/imagefilledpolygon.xml +++ b/reference/image/functions/imagefilledpolygon.xml @@ -1,6 +1,6 @@ - + @@ -123,12 +123,11 @@ $blue = imagecolorallocate($image, 0, 0, 255); imagefilledrectangle($image, 0, 0, 249, 249, $bg); // 绘制多边形 -imagefilledpolygon($image, $values, 6, $blue); +imagefilledpolygon($image, $values, $blue); // 输出图像 header('Content-type: image/png'); imagepng($image); -imagedestroy($image); ?> ]]> diff --git a/reference/image/functions/imagefilledrectangle.xml b/reference/image/functions/imagefilledrectangle.xml index 8087ca871..e75178e94 100644 --- a/reference/image/functions/imagefilledrectangle.xml +++ b/reference/image/functions/imagefilledrectangle.xml @@ -1,6 +1,6 @@ - + @@ -103,16 +103,15 @@ ]]> diff --git a/reference/image/functions/imagefilltoborder.xml b/reference/image/functions/imagefilltoborder.xml index 69c12d9e3..50ffbcbde 100644 --- a/reference/image/functions/imagefilltoborder.xml +++ b/reference/image/functions/imagefilltoborder.xml @@ -1,6 +1,6 @@ - + @@ -95,24 +95,23 @@ ]]> diff --git a/reference/image/functions/imagefilter.xml b/reference/image/functions/imagefilter.xml index 97ed18f9c..315bd7fe1 100755 --- a/reference/image/functions/imagefilter.xml +++ b/reference/image/functions/imagefilter.xml @@ -1,6 +1,6 @@ - + @@ -38,9 +38,9 @@ - IMG_FILTER_GRAYSCALE:将图像转换为灰度, - 通过使用与 REC.601 亮度 (Y') 计算相同的系数来更改红色、绿色和蓝色分量的加权和。 - 保留 alpha 分量。对于调色板图像,由于调色板限制,结果可能有所不同。 + IMG_FILTER_GRAYSCALE:将图像转换为灰度,通过使用与 REC.601 + 亮度 (Y') 计算相同的系数来更改红色、绿色和蓝色分量的加权和。保留 alpha + 分量。对于调色板图像,由于调色板限制,结果可能有所不同。 @@ -221,8 +221,7 @@ &reftitle.errors; - 抛出 ValueError 异常, - 如果 subplus + 抛出 ValueError 异常,如果 subplus 会导致 IMG_FILTER_SCATTER filter 的溢出/下溢。 @@ -242,8 +241,7 @@ 8.4.0 - 现在抛出 ValueError 异常, - 如果 subplus + 现在抛出 ValueError 异常,如果 subplus 会导致 IMG_FILTER_SCATTER filter 的溢出/下溢。 @@ -279,8 +277,6 @@ else { echo 'Conversion to grayscale failed.'; } - -imagedestroy($im); ?> ]]> @@ -299,7 +295,6 @@ if($im && imagefilter($im, IMG_FILTER_BRIGHTNESS, 20)) echo 'Image brightness changed.'; imagepng($im, 'sean.png'); - imagedestroy($im); } else { @@ -318,13 +313,12 @@ else ]]> @@ -431,22 +419,21 @@ imagedestroy($output); ]]> &example.outputs.similar; - Output of example : imagefilter() scatter + 输出示例:imagefilter() 散射 diff --git a/reference/image/functions/imageftbbox.xml b/reference/image/functions/imageftbbox.xml index b3fc7382f..d95cce7f6 100644 --- a/reference/image/functions/imageftbbox.xml +++ b/reference/image/functions/imageftbbox.xml @@ -1,6 +1,6 @@ - + @@ -22,8 +22,9 @@ - 在 PHP 8.0.0 之前,imageftbboximagettfbbox 的扩展变体,它还支持 options。 - 自 PHP 8.0.0 起,imagettfbboximageftbbox 的别名。 + 在 PHP 8.0.0 之前,imageftbboximagettfbbox 的扩展变体,它还支持 + options。自 PHP 8.0.0 起,imagettfbbox 是 + imageftbbox 的别名。 @@ -150,31 +151,30 @@ ]]> diff --git a/reference/image/functions/imagefttext.xml b/reference/image/functions/imagefttext.xml index 843cd5d0f..2ee4fd511 100644 --- a/reference/image/functions/imagefttext.xml +++ b/reference/image/functions/imagefttext.xml @@ -1,6 +1,6 @@ - + @@ -23,8 +23,9 @@ - 在 PHP 8.0.0 之前,imagefttextimagettftext 的扩展变体,它还支持 options。 - 自 PHP 8.0.0 起,imagettftextimagefttext 的别名。 + 在 PHP 8.0.0 之前,imagefttextimagettftext 的扩展变体,它还支持 + options。自 PHP 8.0.0 起,imagettftext 是 + imagefttext 的别名。 @@ -94,7 +95,7 @@ // 设置 GD 的环境变量 putenv('GDFONTPATH=' . realpath('.')); -// Name the font to be used (note the lack of the .ttf extension) +// 要使用的字体名称(注意没有 .ttf 扩展名) $font = 'SomeFont'; ?> ]]> @@ -212,25 +213,24 @@ $font = 'SomeFont'; ]]> diff --git a/reference/image/functions/imagegammacorrect.xml b/reference/image/functions/imagegammacorrect.xml index cd2d62239..7cb813c56 100644 --- a/reference/image/functions/imagegammacorrect.xml +++ b/reference/image/functions/imagegammacorrect.xml @@ -1,6 +1,6 @@ - + @@ -75,15 +75,14 @@ ]]> diff --git a/reference/image/functions/imagegd.xml b/reference/image/functions/imagegd.xml index 05a8128b5..ffe83a1c0 100644 --- a/reference/image/functions/imagegd.xml +++ b/reference/image/functions/imagegd.xml @@ -1,6 +1,6 @@ - + @@ -79,16 +79,13 @@ ]]> @@ -100,17 +97,14 @@ imagedestroy($im); ]]> diff --git a/reference/image/functions/imagegd2.xml b/reference/image/functions/imagegd2.xml index 74a91dfd4..828ac3b90 100644 --- a/reference/image/functions/imagegd2.xml +++ b/reference/image/functions/imagegd2.xml @@ -1,6 +1,6 @@ - + @@ -90,16 +90,13 @@ ]]> @@ -111,17 +108,14 @@ imagedestroy($im); ]]> diff --git a/reference/image/functions/imagegif.xml b/reference/image/functions/imagegif.xml index 6bdb805bc..9a4361cfd 100644 --- a/reference/image/functions/imagegif.xml +++ b/reference/image/functions/imagegif.xml @@ -1,6 +1,6 @@ - + @@ -84,7 +84,6 @@ imagestring($im, 3, 40, 20, 'GD Library', 0xFFBA00); header('Content-Type: image/gif'); imagegif($im); -imagedestroy($im); ?> ]]> @@ -101,9 +100,6 @@ $png = imagecreatefrompng('./php.png'); // 以 GIF 保存图像 imagegif($png, './php.gif'); -// 释放内存 -imagedestroy($png); - // 完工 echo 'Converted PNG image to GIF with success!'; ?> @@ -158,16 +154,8 @@ elseif(function_exists('imagewbmp')) } else { - imagedestroy($im); - die('No image support in this PHP server'); } - -// 如果发现图像是以上的格式之一,就从内存中释放 -if($im) -{ - imagedestroy($im); -} ?> ]]> diff --git a/reference/image/functions/imageinterlace.xml b/reference/image/functions/imageinterlace.xml index 8ca22ca46..1a9a57cb1 100644 --- a/reference/image/functions/imageinterlace.xml +++ b/reference/image/functions/imageinterlace.xml @@ -1,6 +1,6 @@ - + @@ -89,7 +89,6 @@ imageinterlace($im, true); // 保存隔行扫描图像 imagegif($im, './php_interlaced.gif'); -imagedestroy($im); ?> ]]> diff --git a/reference/image/functions/imageistruecolor.xml b/reference/image/functions/imageistruecolor.xml index 9bb51360c..0134d4f29 100644 --- a/reference/image/functions/imageistruecolor.xml +++ b/reference/image/functions/imageistruecolor.xml @@ -1,6 +1,6 @@ - + @@ -58,17 +58,16 @@ ]]> diff --git a/reference/image/functions/imagejpeg.xml b/reference/image/functions/imagejpeg.xml index 13367e174..de23f5be0 100644 --- a/reference/image/functions/imagejpeg.xml +++ b/reference/image/functions/imagejpeg.xml @@ -1,6 +1,6 @@ - + @@ -99,9 +99,6 @@ header('Content-Type: image/jpeg'); // 输出图像 imagejpeg($im); - -// 释放内存 -imagedestroy($im); ?> ]]> @@ -127,9 +124,6 @@ imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color); // 保存图像为“simpletext.jpg” imagejpeg($im, 'simpletext.jpg'); - -// 释放内存 -imagedestroy($im); ?> ]]> @@ -151,9 +145,6 @@ header('Content-Type: image/jpeg'); // 使用 NULL 跳过 file 参数,并设置图像质量为 75% imagejpeg($im, NULL, 75); - -// 释放内存 -imagedestroy($im); ?> ]]> diff --git a/reference/image/functions/imagelayereffect.xml b/reference/image/functions/imagelayereffect.xml index 6dc1fcb7c..16bf75512 100755 --- a/reference/image/functions/imagelayereffect.xml +++ b/reference/image/functions/imagelayereffect.xml @@ -1,6 +1,6 @@ - + @@ -113,25 +113,24 @@ ]]> diff --git a/reference/image/functions/imageloadfont.xml b/reference/image/functions/imageloadfont.xml index 90129c802..5685093a4 100644 --- a/reference/image/functions/imageloadfont.xml +++ b/reference/image/functions/imageloadfont.xml @@ -1,6 +1,6 @@ - + @@ -116,23 +116,22 @@ ]]> diff --git a/reference/image/functions/imagepalettecopy.xml b/reference/image/functions/imagepalettecopy.xml index 1053b8cec..0381e845c 100644 --- a/reference/image/functions/imagepalettecopy.xml +++ b/reference/image/functions/imagepalettecopy.xml @@ -1,6 +1,6 @@ - + @@ -80,28 +80,26 @@ ]]> diff --git a/reference/image/functions/imagepng.xml b/reference/image/functions/imagepng.xml index 3508abc21..ea7ab0086 100644 --- a/reference/image/functions/imagepng.xml +++ b/reference/image/functions/imagepng.xml @@ -1,6 +1,6 @@ - + @@ -114,7 +114,6 @@ $im = imagecreatefrompng("test.png"); header('Content-Type: image/png'); imagepng($im); -imagedestroy($im); ?> ]]>