cvs: phpdoc /en/reference/image/functions exif-thumbnail.xml

From: Date: Fri, 16 Aug 2002 16:43:45 +0000
Subject: cvs: phpdoc /en/reference/image/functions exif-thumbnail.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969348131@lists.php.net to get a copy of this message
helly Fri Aug 16 12:43:45 2002 EDT Modified files: /phpdoc/en/reference/image/functions exif-thumbnail.xml Log: example with image_type_to_mime_type Index: phpdoc/en/reference/image/functions/exif-thumbnail.xml diff -u phpdoc/en/reference/image/functions/exif-thumbnail.xml:1.2 phpdoc/en/reference/image/functions/exif-thumbnail.xml:1.3 --- phpdoc/en/reference/image/functions/exif-thumbnail.xml:1.2 Wed Apr 17 02:39:09 2002 +++ phpdoc/en/reference/image/functions/exif-thumbnail.xml Fri Aug 16 12:43:45 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.78 --> <refentry id="function.exif-thumbnail"> <refnamediv> @@ -13,6 +13,7 @@ <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 @@ -20,13 +21,41 @@ will be returned. </para> <para> - Both parameters <parameter>width</parameter> and <parameter>height</parameter> are - available since PHP 4.3 and return the size of the thumbnail. It is possible that + The parameters <parameter>width</parameter>, <parameter>height</parameter> and + <parameter>imagetype</parameter> are available since PHP 4.3 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 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 <function>header</function> function. The following + example demonstrates this: + <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 the function <function>exif_thumbnail</function> can return thumbnails in <acronym>TIFF</acronym> format. </para> @@ -41,7 +70,7 @@ This function does not require the GD image library. </simpara> <simpara> - See also <function>exif_read_data</function>. + See also <function>exif_read_data</function> and <function>image_type_to_mime_type</function>. </simpara> </note> </para>

« previous php.doc (#969348131) next »