php-doc-en/reference/image/functions/exif-thumbnail.xml
Philip Olson 1846bab5f1 Minor format fixes.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@128940 c90b9560-bf6c-de11-be94-00142212c4b1
2003-05-27 19:17:51 +00:00

104 lines
3.3 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/image.xml, last change in rev 1.78 -->
<refentry id="function.exif-thumbnail">
<refnamediv>
<refname>exif_thumbnail</refname>
<refpurpose>Retrieve the embedded thumbnail of a TIFF or JPEG image</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>exif_thumbnail</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>&amp;width</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>&amp;height</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>&amp;imagetype</parameter></methodparam>
</methodsynopsis>
<para>
<function>exif_thumbnail</function> reads the embedded thumbnail of
a TIFF or JPEG image. If the image contains no thumbnail &false;
will be returned.
</para>
<para>
The parameters <parameter>width</parameter>,
<parameter>height</parameter> and <parameter>imagetype</parameter> are
available since PHP 4.3.0 and return the size of the thumbnail as well
as its type. It is possible that <function>exif_thumbnail</function>
cannot create an image but can determine its size. In this case, the
return value is &false; but <parameter>width</parameter> and
<parameter>height</parameter> are set.
</para>
<para>
If you want to deliver thumbnails through this function, you should send
the mimetype information using the <function>header</function> function.
The following example demonstrates this:
</para>
<para>
<example>
<title><function>exif_thumbnail</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
if (array_key_exists('file',$_REQUEST)) {
$image = exif_thumbnail($_REQUEST['file'], $width, $height, $type);
} else {
$image = false;
}
if ($image!==false) {
header("Content-type: ".image_type_to_mime_type($type));
echo $image;
exit;
} else {
// no thumbnail available, handle the error here
echo "No thumbnail available";
}
?>
]]>
</programlisting>
</example>
</para>
<para>
Starting from version PHP 4.3.0, the function
<function>exif_thumbnail</function> can return thumbnails in
<acronym>TIFF</acronym> format.
</para>
<note>
<simpara>
This function is only available in PHP 4 compiled using
<option role="configure">--enable-exif</option>.
Its functionality and behaviour has changed in PHP 4.2.0
</simpara>
</note>
<note>
<simpara>
This function does not require the GD image library.
</simpara>
</note>
<simpara>
See also <function>exif_read_data</function> and
<function>image_type_to_mime_type</function>.
</simpara>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->