reference/image/functions/getimagesize.xml
d0532e45fb2b6766c7fc73c7ccfc30a9720f8888
...
...
@@ -8,21 +8,34 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>array</type><methodname>getimagesize</methodname>
11
+
<type class="union"><type>array</type><type>false</type></type><methodname>getimagesize</methodname>
12
12
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
13
-
<methodparam choice="opt"><type>array</type><parameter role="reference">imageinfo</parameter></methodparam>
13
+
<methodparam choice="opt"><type>array</type><parameter role="reference">image_info</parameter><initializer>&null;</initializer></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
16
The <function>getimagesize</function> function will determine the
17
-
size of any given image file and return the dimensions along with
17
+
size of any supported given image file and return the dimensions along with
18
18
the file type and a <literal>height/width</literal> text string to be used inside a
19
19
normal <acronym>HTML</acronym> <tag>IMG</tag> tag and the
20
20
correspondent <acronym>HTTP</acronym> content type.
21
21
</para>
22
22
<para>
23
23
<function>getimagesize</function> can also return some more information
24
-
in <parameter>imageinfo</parameter> parameter.
24
+
in <parameter>image_info</parameter> parameter.
25
25
</para>
26
+
<caution>
27
+
<para>
28
+
This function expects <parameter>filename</parameter> to be a valid
29
+
image file. If a non-image file is supplied, it may be incorrectly
30
+
detected as an image and the function will return successfully, but
31
+
the array may contain nonsensical values.
32
+
</para>
33
+
<para>
34
+
Do not use <function>getimagesize</function> to check that a given
35
+
file is a valid image. Use a purpose-built solution such as the
36
+
<link linkend="book.fileinfo">Fileinfo</link> extension instead.
37
+
</para>
38
+
</caution>
26
39
<note>
27
40
<simpara>
28
41
Note that JPC and JP2 are capable of having components with different
...
...
@@ -38,6 +51,14 @@
38
51
bitrate.
39
52
</simpara>
40
53
</note>
54
+
<note>
55
+
<simpara>
56
+
GIF images consist of one or more frames, where each frame may only occupy
57
+
part of the image. The size of the image which is reported by
58
+
<function>getimagesize</function> is the overall size (read from the logical
59
+
screen descriptor).
60
+
</simpara>
61
+
</note>
41
62
</refsect1>
42
63
43
64
<refsect1 role="parameters">
...
...
@@ -50,12 +71,12 @@
50
71
<para>
51
72
This parameter specifies the file you wish to retrieve information
52
73
about. It can reference a local file or (configuration permitting) a
53
-
remote file using one of the supported streams.
74
+
remote file using one of the <link linkend="wrappers">supported streams</link>.
54
75
</para>
55
76
</listitem>
56
77
</varlistentry>
57
78
<varlistentry>
58
-
<term><parameter>imageinfo</parameter></term>
79
+
<term><parameter>image_info</parameter></term>
59
80
<listitem>
60
81
<para>
61
82
This optional parameter allows you to extract some extended
...
...
@@ -67,6 +88,12 @@
67
88
You can use the <function>iptcparse</function> function to parse the
68
89
binary APP13 marker into something readable.
69
90
</para>
91
+
<note>
92
+
<para>
93
+
The <parameter>image_info</parameter> only supports
94
+
<acronym>JFIF</acronym> files.
95
+
</para>
96
+
</note>
70
97
</listitem>
71
98
</varlistentry>
72
99
</variablelist>
...
...
@@ -165,58 +192,17 @@ if ($size && $fp) {
165
192
</thead>
166
193
<tbody>
167
194
<row>
168
-
<entry>5.3.0</entry>
169
-
<entry>
170
-
Added icon support.
171
-
</entry>
172
-
</row>
173
-
<row>
174
-
<entry>5.2.3</entry>
175
-
<entry>
176
-
Read errors generated by this function downgraded to
177
-
<constant>E_NOTICE</constant> from <constant>E_WARNING</constant>.
178
-
</entry>
179
-
</row>
180
-
<row>
181
-
<entry>4.3.2</entry>
182
-
<entry>
183
-
Support for <acronym>JPC</acronym>, <acronym>JP2</acronym>,
184
-
<acronym>JPX</acronym>, <acronym>JB2</acronym>,
185
-
<acronym>XBM</acronym>, and <acronym>WBMP</acronym> became available.
186
-
</entry>
187
-
</row>
188
-
<row>
189
-
<entry>4.3.2</entry>
190
-
<entry>
191
-
JPEG 2000 support was added for the <parameter>imageinfo</parameter>
192
-
parameter.
193
-
</entry>
194
-
</row>
195
-
<row>
196
-
<entry>4.3.0</entry>
197
-
<entry>
198
-
<literal>bits</literal> and <literal>channels</literal> are present
199
-
for other image types, too.
200
-
</entry>
201
-
</row>
202
-
<row>
203
-
<entry>4.3.0</entry>
195
+
<entry>8.2.0</entry>
204
196
<entry>
205
-
Support for <acronym>SWC</acronym> and <acronym>IFF</acronym> was
206
-
added.
197
+
Now returns the actual image dimensions, bits and channels of AVIF images;
198
+
previously, the dimensions were reported as <literal>0x0</literal>,
199
+
and bits and channels were not reported at all.
207
200
</entry>
208
201
</row>
209
202
<row>
210
-
<entry>4.2.0</entry>
203
+
<entry>7.1.0</entry>
211
204
<entry>
212
-
Support for <acronym>TIFF</acronym> was added.
213
-
</entry>
214
-
</row>
215
-
<row>
216
-
<entry>4.0.6</entry>
217
-
<entry>
218
-
Support for <acronym>BMP</acronym> and <acronym>PSD</acronym> was
219
-
added.
205
+
Added WebP support.
220
206
</entry>
221
207
</row>
222
208
</tbody>
...
...
@@ -273,33 +259,20 @@ if (isset($info["APP13"])) {
273
259
<refsect1 role="notes">
274
260
&reftitle.notes;
275
261
&note.gd.notrequired;
276
-
<note>
277
-
<para>
278
-
This function expects <parameter>filename</parameter> to be a valid
279
-
image file. If a non-image file is supplied, it may be incorrectly
280
-
detected as an image and the function will return successfully.
281
-
</para>
282
-
<para>
283
-
Do not use <function>getimagesize</function> to check that a given
284
-
file is a valid image. Use a purpose-built solution such as the
285
-
<link linkend="book.fileinfo">Fileinfo</link> extension instead.
286
-
</para>
287
-
</note>
288
262
</refsect1>
289
263
290
264
<refsect1 role="seealso">
291
265
&reftitle.seealso;
292
-
<para>
293
-
<simplelist>
294
-
<member><function>image_type_to_mime_type</function></member>
295
-
<member><function>exif_imagetype</function></member>
296
-
<member><function>exif_read_data</function></member>
297
-
<member><function>exif_thumbnail</function></member>
298
-
</simplelist>
299
-
</para>
266
+
<simplelist>
267
+
<member><function>image_type_to_mime_type</function></member>
268
+
<member><function>exif_imagetype</function></member>
269
+
<member><function>exif_read_data</function></member>
270
+
<member><function>exif_thumbnail</function></member>
271
+
<member><function>imagesx</function></member>
272
+
<member><function>imagesy</function></member>
273
+
</simplelist>
300
274
</refsect1>
301
275
</refentry>
302
-

303
276
<!-- Keep this comment at the end of the file
304
277
Local variables:
305
278
mode: sgml
...
...
@@ -320,4 +293,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
320
293
vim: et tw=78 syn=sgml
321
294
vi: ts=1 sw=1
322
295
-->
323
-

324
296