reference/image/functions/imagejpeg.xml
80b2563f1fb2e2830f6881b4620adf773065f9e7
...
...
@@ -9,9 +9,9 @@
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>bool</type><methodname>imagejpeg</methodname>
12
-
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
13
-
<methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam>
14
-
<methodparam choice="opt"><type>int</type><parameter>quality</parameter></methodparam>
12
+
<methodparam><type>GdImage</type><parameter>image</parameter></methodparam>
13
+
<methodparam choice="opt"><type class="union"><type>resource</type><type>string</type><type>null</type></type><parameter>file</parameter><initializer>&null;</initializer></methodparam>
14
+
<methodparam choice="opt"><type>int</type><parameter>quality</parameter><initializer>-1</initializer></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
<function>imagejpeg</function> creates a <acronym>JPEG</acronym> file from
...
...
@@ -24,13 +24,9 @@
24
24
<variablelist>
25
25
&gd.image.description;
26
26
<varlistentry>
27
-
<term><parameter>filename</parameter></term>
27
+
<term><parameter>file</parameter></term>
28
28
<listitem>
29
29
<para>&gd.image.path;</para>
30
-
<para>
31
-
To skip this argument in order to provide the
32
-
<parameter>quality</parameter> parameter, use &null;.
33
-
</para>
34
30
</listitem>
35
31
</varlistentry>
36
32
<varlistentry>
...
...
@@ -39,7 +35,7 @@
39
35
<para>
40
36
<parameter>quality</parameter> is optional, and ranges from 0 (worst
41
37
quality, smaller file) to 100 (best quality, biggest file). The
42
-
default is the default IJG quality value (about 75).
38
+
default (<literal>-1</literal>) uses the default IJG quality value (about 75).
43
39
</para>
44
40
</listitem>
45
41
</varlistentry>
...
...
@@ -51,12 +47,31 @@
51
47
<para>
52
48
&return.success;
53
49
</para>
50
+
&gd.return.trueonerror;
54
51
</refsect1>
52
+

53
+
<refsect1 role="changelog">
54
+
&reftitle.changelog;
55
+
<informaltable>
56
+
<tgroup cols="2">
57
+
<thead>
58
+
<row>
59
+
<entry>&Version;</entry>
60
+
<entry>&Description;</entry>
61
+
</row>
62
+
</thead>
63
+
<tbody>
64
+
&gd.changelog.image-param;
65
+
</tbody>
66
+
</tgroup>
67
+
</informaltable>
68
+
</refsect1>
69
+

55
70
<refsect1 role="examples">
56
71
&reftitle.examples;
57
72
<para>
58
73
<example>
59
-
<title>Outputting a JPEG image</title>
74
+
<title>Outputting a JPEG image to the browser</title>
60
75
<programlisting role="php">
61
76
<![CDATA[
62
77
<?php
...
...
@@ -87,7 +102,7 @@ imagedestroy($im);
87
102
</para>
88
103
<para>
89
104
<example>
90
-
<title>Saving a JPEG image</title>
105
+
<title>Saving a JPEG image to a file</title>
91
106
<programlisting role="php">
92
107
<![CDATA[
93
108
<?php
...
...
@@ -108,7 +123,7 @@ imagedestroy($im);
108
123
</para>
109
124
<para>
110
125
<example>
111
-
<title>Outputting the image at 75% quality</title>
126
+
<title>Outputting the image at 75% quality to the browser</title>
112
127
<programlisting role="php">
113
128
<![CDATA[
114
129
<?php
...
...
@@ -120,7 +135,7 @@ imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
120
135
// Set the content type header - in this case image/jpeg
121
136
header('Content-Type: image/jpeg');
122
137

123
-
// Skip the filename parameter using NULL, then set the quality to 75%
138
+
// Skip the file parameter using NULL, then set the quality to 75%
124
139
imagejpeg($im, NULL, 75);
125
140

126
141
// Free up memory
...
...
@@ -133,7 +148,6 @@ imagedestroy($im);
133
148
</refsect1>
134
149
<refsect1 role="notes">
135
150
&reftitle.notes;
136
-
&note.config.jpeg;
137
151
<note>
138
152
<para>
139
153
If you want to output Progressive JPEGs, you need to set interlacing
...
...
@@ -141,20 +155,18 @@ imagedestroy($im);
141
155
</para>
142
156
</note>
143
157
</refsect1>
158
+

144
159
<refsect1 role="seealso">
145
160
&reftitle.seealso;
146
-
<para>
147
-
<simplelist>
148
-
<member><function>imagepng</function></member>
149
-
<member><function>imagegif</function></member>
150
-
<member><function>imagewbmp</function></member>
151
-
<member><function>imageinterlace</function></member>
152
-
<member><function>imagetypes</function></member>
153
-
</simplelist>
154
-
</para>
161
+
<simplelist>
162
+
<member><function>imagepng</function></member>
163
+
<member><function>imagegif</function></member>
164
+
<member><function>imagewbmp</function></member>
165
+
<member><function>imageinterlace</function></member>
166
+
<member><function>imagetypes</function></member>
167
+
</simplelist>
155
168
</refsect1>
156
169
</refentry>
157
-

158
170
<!-- Keep this comment at the end of the file
159
171
Local variables:
160
172
mode: sgml
161
173