reference/exif/functions/exif-thumbnail.xml
cbac1ecf71d754707d69bdc344c4031c157eaa54
...
...
@@ -4,20 +4,19 @@
4
4
<refentry xml:id="function.exif-thumbnail" xmlns="http://docbook.org/ns/docbook">
5
5
<refnamediv>
6
6
<refname>exif_thumbnail</refname>
7
-
<refpurpose>Retrieve the embedded thumbnail of a TIFF or JPEG image</refpurpose>
7
+
<refpurpose>Retrieve the embedded thumbnail of an image</refpurpose>
8
8
</refnamediv>
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>string</type><methodname>exif_thumbnail</methodname>
13
-
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
14
-
<methodparam choice="opt"><type>int</type><parameter role="reference">width</parameter></methodparam>
15
-
<methodparam choice="opt"><type>int</type><parameter role="reference">height</parameter></methodparam>
16
-
<methodparam choice="opt"><type>int</type><parameter role="reference">imagetype</parameter></methodparam>
12
+
<type class="union"><type>string</type><type>false</type></type><methodname>exif_thumbnail</methodname>
13
+
<methodparam><type class="union"><type>resource</type><type>string</type></type><parameter>file</parameter></methodparam>
14
+
<methodparam choice="opt"><type>int</type><parameter role="reference">width</parameter><initializer>&null;</initializer></methodparam>
15
+
<methodparam choice="opt"><type>int</type><parameter role="reference">height</parameter><initializer>&null;</initializer></methodparam>
16
+
<methodparam choice="opt"><type>int</type><parameter role="reference">image_type</parameter><initializer>&null;</initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
-
<function>exif_thumbnail</function> reads the embedded thumbnail of a
20
-
<acronym>TIFF</acronym> or <acronym>JPEG</acronym> image.
19
+
<function>exif_thumbnail</function> reads the embedded thumbnail of an image.
21
20
</para>
22
21
<para>
23
22
If you want to deliver thumbnails through this function, you should send
...
...
@@ -35,11 +34,11 @@
35
34
<para>
36
35
<variablelist>
37
36
<varlistentry>
38
-
<term><parameter>filename</parameter></term>
37
+
<term><parameter>file</parameter></term>
39
38
<listitem>
40
39
<para>
41
-
The name of the image file being read. This image contains an
42
-
embedded thumbnail.
40
+
The location of the image file. This can either be a path to the file
41
+
or a stream <type>resource</type>.
43
42
</para>
44
43
</listitem>
45
44
</varlistentry>
...
...
@@ -60,7 +59,7 @@
60
59
</listitem>
61
60
</varlistentry>
62
61
<varlistentry>
63
-
<term><parameter>imagetype</parameter></term>
62
+
<term><parameter>image_type</parameter></term>
64
63
<listitem>
65
64
<para>
66
65
The returned image type of the returned thumbnail. This is either
...
...
@@ -78,6 +77,32 @@
78
77
thumbnail.
79
78
</para>
80
79
</refsect1>
80
+

81
+
<refsect1 role="changelog">
82
+
&reftitle.changelog;
83
+
<para>
84
+
<informaltable>
85
+
<tgroup cols="2">
86
+
<thead>
87
+
<row>
88
+
<entry>&Version;</entry>
89
+
<entry>&Description;</entry>
90
+
</row>
91
+
</thead>
92
+
<tbody>
93
+
<row>
94
+
<entry>7.2.0</entry>
95
+
<entry>
96
+
The <parameter>file</parameter> parameter now supports both local files
97
+
and stream resources.
98
+
</entry>
99
+
</row>
100
+
</tbody>
101
+
</tgroup>
102
+
</informaltable>
103
+
</para>
104
+
</refsect1>
105
+

81
106
<refsect1 role="examples">
82
107
&reftitle.examples;
83
108
<para>
...
...
@@ -86,11 +111,8 @@
86
111
<programlisting role="php">
87
112
<![CDATA[
88
113
<?php
89
-
if (array_key_exists('file', $_REQUEST)) {
90
-
$image = exif_thumbnail($_REQUEST['file'], $width, $height, $type);
91
-
} else {
92
-
$image = false;
93
-
}
114
+
$image = exif_thumbnail('/path/to/image.jpg', $width, $height, $type);
115
+

94
116
if ($image!==false) {
95
117
header('Content-type: ' .image_type_to_mime_type($type));
96
118
echo $image;
...
...
@@ -105,6 +127,16 @@ if ($image!==false) {
105
127
</example>
106
128
</para>
107
129
</refsect1>
130
+

131
+
<refsect1 role="notes">
132
+
&reftitle.notes;
133
+
<note>
134
+
<para>
135
+
If the <parameter>file</parameter> is used to pass a stream to this function, then the stream
136
+
must be seekable. Note that the file pointer position is not changed after this function returns.
137
+
</para>
138
+
</note>
139
+
</refsect1>
108
140
<refsect1 role="seealso">
109
141
&reftitle.seealso;
110
142
<para>
...
...
@@ -115,7 +147,6 @@ if ($image!==false) {
115
147
</para>
116
148
</refsect1>
117
149
</refentry>
118
-

119
150
<!-- Keep this comment at the end of the file
120
151
Local variables:
121
152
mode: sgml
122
153