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,7 @@
78
77
thumbnail.
79
78
</para>
80
79
</refsect1>
80
+

81
81
<refsect1 role="changelog">
82
82
&reftitle.changelog;
83
83
<para>
...
...
@@ -91,17 +91,10 @@
91
91
</thead>
92
92
<tbody>
93
93
<row>
94
-
<entry>4.3.0</entry>
95
-
<entry>
96
-
The optional parameters <parameter>width</parameter>,
97
-
<parameter>height</parameter>, and <parameter>imagetype</parameter>
98
-
all became available.
99
-
</entry>
100
-
</row>
101
-
<row>
102
-
<entry>4.3.0</entry>
94
+
<entry>7.2.0</entry>
103
95
<entry>
104
-
May return thumbnails in the <acronym>TIFF</acronym> format.
96
+
The <parameter>file</parameter> parameter now supports both local files
97
+
and stream resources.
105
98
</entry>
106
99
</row>
107
100
</tbody>
...
...
@@ -109,6 +102,7 @@
109
102
</informaltable>
110
103
</para>
111
104
</refsect1>
105
+

112
106
<refsect1 role="examples">
113
107
&reftitle.examples;
114
108
<para>
...
...
@@ -117,11 +111,8 @@
117
111
<programlisting role="php">
118
112
<![CDATA[
119
113
<?php
120
-
if (array_key_exists('file', $_REQUEST)) {
121
-
$image = exif_thumbnail($_REQUEST['file'], $width, $height, $type);
122
-
} else {
123
-
$image = false;
124
-
}
114
+
$image = exif_thumbnail('/path/to/image.jpg', $width, $height, $type);
115
+

125
116
if ($image!==false) {
126
117
header('Content-type: ' .image_type_to_mime_type($type));
127
118
echo $image;
...
...
@@ -136,6 +127,16 @@ if ($image!==false) {
136
127
</example>
137
128
</para>
138
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>
139
140
<refsect1 role="seealso">
140
141
&reftitle.seealso;
141
142
<para>
...
...
@@ -146,7 +147,6 @@ if ($image!==false) {
146
147
</para>
147
148
</refsect1>
148
149
</refentry>
149
-

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