Skip to content

Commit 467658c

Browse files
committed
gd: do not use or unnecessary reference imagedestroy()
php/doc-en@9960a09
1 parent de74802 commit 467658c

File tree

79 files changed

+86
-258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+86
-258
lines changed

reference/image/examples.xml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 10c69571e7dd8a7cc0fbc9f20a55d24b1b1032be Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: takagi Status: ready -->
44
<!-- CREDITS: hirokawa -->
55

66
<chapter xml:id="image.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -21,7 +21,6 @@ $orange = imagecolorallocate($im, 220, 210, 60);
2121
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
2222
imagestring($im, 3, $px, 9, $string, $orange);
2323
imagepng($im);
24-
imagedestroy($im);
2524
2625
?>
2726
]]>
@@ -59,10 +58,9 @@ $sy = imagesy($stamp);
5958
// 写真の幅を元にスタンプの位置を決定します
6059
imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));
6160
62-
// 出力し、メモリを開放します
61+
// 出力します
6362
header('Content-type: image/png');
6463
imagepng($im);
65-
imagedestroy($im);
6664
?>
6765
]]>
6866
</programlisting>
@@ -105,9 +103,8 @@ $sy = imagesy($stamp);
105103
// スタンプを、50% の不透明度で写真に重ねます
106104
imagecopymerge($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp), 50);
107105
108-
// 画像をファイルに保存し、メモリを開放します
106+
// 画像をファイルに保存します
109107
imagepng($im, 'photo_stamp.png');
110-
imagedestroy($im);
111108
112109
?>
113110
]]>

reference/image/functions/image-type-to-extension.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 89ae180a851621c308f0ea4604ff2e919aa57a7f Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: takagi Status: ready -->
44
<!-- Credits: mumumu -->
55
<refentry xml:id="function.image-type-to-extension" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -65,7 +65,6 @@ $im = imagecreatetruecolor(100, 100);
6565
6666
// 画像を保存します
6767
imagepng($im, './test' . image_type_to_extension(IMAGETYPE_PNG));
68-
imagedestroy($im);
6968
?>
7069
]]>
7170
</programlisting>

reference/image/functions/image2wbmp.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 593ea510e853ff034e03f78a4be0daa41661c9d4 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: shimooka,mumumu -->
55
<refentry xml:id="function.image2wbmp" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -81,7 +81,6 @@ $image = imagecreatefrompng($file);
8181
8282
header('Content-Type: ' . image_type_to_mime_type(IMAGETYPE_WBMP));
8383
image2wbmp($image); // ストリームを直接出力します。
84-
imagedestroy($image);
8584
?>
8685
]]>
8786
</programlisting>

reference/image/functions/imagealphablending.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 593ea510e853ff034e03f78a4be0daa41661c9d4 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: shimooka -->
55
<refentry xml:id="function.imagealphablending" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -87,7 +87,6 @@ imagefilledrectangle($im, 30, 30, 70, 70, imagecolorallocate($im, 255, 0, 0));
8787
header('Content-Type: image/png');
8888
8989
imagepng($im);
90-
imagedestroy($im);
9190
?>
9291
]]>
9392
</programlisting>

reference/image/functions/imageantialias.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 593ea510e853ff034e03f78a4be0daa41661c9d4 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: shimooka,takagi,mumumu -->
55
<refentry xml:id="function.imageantialias" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -107,8 +107,6 @@ imagecopymerge($aa, $normal, 200, 0, 0, 0, 200, 100, 100);
107107
header('Content-type: image/png');
108108
109109
imagepng($aa);
110-
imagedestroy($aa);
111-
imagedestroy($normal);
112110
?>
113111
]]>
114112
</programlisting>

reference/image/functions/imagearc.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 593ea510e853ff034e03f78a4be0daa41661c9d4 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: shimooka,mumumu -->
55
<refentry xml:id="function.imagearc" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -143,9 +143,6 @@ imagearc($img, 140, 75, 50, 50, 0, 360, $blue);
143143
header("Content-type: image/png");
144144
imagepng($img);
145145
146-
// メモリを解放します
147-
imagedestroy($img);
148-
149146
?>
150147
]]>
151148
</programlisting>

reference/image/functions/imagebmp.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 593ea510e853ff034e03f78a4be0daa41661c9d4 Maintainer: mumumu Status: ready -->
3+
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: mumumu Status: ready -->
44
<refentry xml:id="function.imagebmp" xmlns="http://docbook.org/ns/docbook">
55
<refnamediv>
66
<refname>imagebmp</refname>
@@ -100,8 +100,6 @@ imagestring($im, 1, 5, 5, 'BMP with PHP', $text_color);
100100
// 画像を保存します。
101101
imagebmp($im, 'php.bmp');
102102
103-
// メモリを解放します。
104-
imagedestroy($im);
105103
?>
106104
]]>
107105
</programlisting>

reference/image/functions/imagecolorallocatealpha.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 593ea510e853ff034e03f78a4be0daa41661c9d4 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: shimooka,mumumu -->
55
<refentry xml:id="function.imagecolorallocatealpha" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -128,7 +128,6 @@ header('Content-Type: image/png');
128128
129129
// 最後に、結果を出力します
130130
imagepng($image);
131-
imagedestroy($image);
132131
?>
133132
]]>
134133
</programlisting>

reference/image/functions/imagecolorclosest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 593ea510e853ff034e03f78a4be0daa41661c9d4 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: shimooka,mumumu -->
55
<refentry xml:id="function.imagecolorclosest" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -108,8 +108,6 @@ foreach($colors as $id => $rgb)
108108
109109
echo "#$id: Search ($rgb[0], $rgb[1], $rgb[2]); Closest match: $result.\n";
110110
}
111-
112-
imagedestroy($im);
113111
?>
114112
]]>
115113
</programlisting>

reference/image/functions/imagecolorclosestalpha.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 593ea510e853ff034e03f78a4be0daa41661c9d4 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: shimooka,mumumu -->
55
<refentry xml:id="function.imagecolorclosestalpha" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -96,8 +96,6 @@ foreach($colors as $id => $rgb)
9696
9797
echo "#$id: Search ($rgb[0], $rgb[1], $rgb[2], $rgb[3]); Closest match: $result.\n";
9898
}
99-
100-
imagedestroy($im);
10199
?>
102100
]]>
103101
</programlisting>

0 commit comments

Comments
 (0)