<HTML ><HEAD ><TITLE >exif_thumbnail</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="Image functions" HREF="ref.image.html"><LINK REL="PREVIOUS" TITLE="exif_read_data" HREF="function.exif-read-data.html"><LINK REL="NEXT" TITLE="gd_info" HREF="function.gd-info.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.exif-read-data.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.gd-info.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.exif-thumbnail" ></A >exif_thumbnail</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN34033" ></A ><P > (PHP 4 >= 4.2.0)</P >exif_thumbnail -- Retrieve the embedded thumbnail of a TIFF or JPEG image</DIV ><DIV CLASS="refsect1" ><A NAME="AEN34036" ></A ><H2 >Description</H2 >string <B CLASS="methodname" >exif_thumbnail</B > ( string filename [, int &width [, int &height [, int &imagetype]]])<BR ></BR ><P > <B CLASS="function" >exif_thumbnail()</B > reads the embedded thumbnail of a TIFF or JPEG image. If the image contains no thumbnail <TT CLASS="constant" ><B >FALSE</B ></TT > will be returned. </P ><P > The parameters <TT CLASS="parameter" ><I >width</I ></TT >, <TT CLASS="parameter" ><I >height</I ></TT > and <TT CLASS="parameter" ><I >imagetype</I ></TT > are available since PHP 4.3 and return the size of the thumbnail as well as its type. It is possible that <B CLASS="function" >exif_thumbnail()</B > cannot create an image but determine its size. In this case the return value is <TT CLASS="constant" ><B >FALSE</B ></TT > but <TT CLASS="parameter" ><I >width</I ></TT > and <TT CLASS="parameter" ><I >height</I ></TT > are set. </P ><P > If you want to deliver thumbnails through this function you should send the mimetype information using <A HREF="function.header.html" ><B CLASS="function" >header()</B ></A > function. The following example demonstrates this: <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN34066" ></A ><P ><B >Example 1. <B CLASS="function" >exif_thumbnail()</B > example</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="php" ><?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"; } ?></PRE ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ><P > Starting from version PHP 4.3 the function <B CLASS="function" >exif_thumbnail()</B > can return thumbnails in <SPAN CLASS="acronym" >TIFF</SPAN > format. </P ><P > <DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Note: </B > This function is only available in PHP 4 compiled using <TT CLASS="option" >--enable-exif</TT >. Its functionality and behaviour has changed in PHP 4.2 </P ><P > This function does not require the GD image library. </P ><P > See also <A HREF="function.exif-read-data.html" ><B CLASS="function" >exif_read_data()</B ></A > and <A HREF="function.image-type-to-mime-type.html" ><B CLASS="function" >image_type_to_mime_type()</B ></A >. </P ></BLOCKQUOTE ></DIV > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.exif-read-data.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.gd-info.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >exif_read_data</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.image.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >gd_info</TD ></TR ></TABLE ></DIV ></BODY ></HTML >