<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >exif_thumbnail</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Manual do PHP" HREF="index.html"><LINK REL="UP" TITLE="Exif Functions" HREF="ref.exif.html"><LINK REL="PREVIOUS" TITLE="exif_tagname" HREF="function.exif-tagname.html"><LINK REL="NEXT" TITLE="read_exif_data" HREF="function.read-exif-data.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></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" >Manual do PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.exif-tagname.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.read-exif-data.html" ACCESSKEY="N" >Próxima</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="AEN44869" ></A ><P > (PHP 4 >= 4.2.0, PHP 5)</P >exif_thumbnail -- Retrieve the embedded thumbnail of a TIFF or JPEG image</DIV ><DIV CLASS="refsect1" ><A NAME="AEN44872" ></A ><H2 >Descrição</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 <ACRONYM CLASS="acronym" >TIFF</ACRONYM > or <ACRONYM CLASS="acronym" >JPEG</ACRONYM > image. </P ><P > If you want to deliver thumbnails through this function, you should send the mimetype information using the <A HREF="function.header.html" ><B CLASS="function" >header()</B ></A > function. </P ><P > It is possible that <B CLASS="function" >exif_thumbnail()</B > cannot create an image but can determine its size. In this case, the return value is <TT CLASS="constant" ><B >FALSE</B ></TT > but <CODE CLASS="parameter" >width</CODE > and <CODE CLASS="parameter" >height</CODE > are set. </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN44900" ></A ><H2 >Parâmetros</H2 ><P > <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><CODE CLASS="parameter" >filename</CODE ></DT ><DD ><P > The name of the image file being read. This image contains an embedded thumbnail. </P ></DD ><DT ><CODE CLASS="parameter" >width</CODE ></DT ><DD ><P > The return width of the returned thumbnail. </P ></DD ><DT ><CODE CLASS="parameter" >height</CODE ></DT ><DD ><P > The returned height of the returned thumbnail. </P ></DD ><DT ><CODE CLASS="parameter" >imagetype</CODE ></DT ><DD ><P > The returned image type of the returned thumbnail. This is either <ACRONYM CLASS="acronym" >TIFF</ACRONYM > or <ACRONYM CLASS="acronym" >JPEG</ACRONYM >. </P ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN44926" ></A ><H2 >Valores de retornado</H2 ><P > Returns the embedded thumbnail, or <TT CLASS="constant" ><B >FALSE</B ></TT > if the image contains no thumbnail. </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN44930" ></A ><H2 >Histórico</H2 ><P > <DIV CLASS="informaltable" ><P ></P ><A NAME="AEN44933" ></A ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><THEAD ><TR ><TH >Versão</TH ><TH >Descrição</TH ></TR ></THEAD ><TBODY ><TR ><TD >4.3.0</TD ><TD > The optional parameters <CODE CLASS="parameter" >width</CODE >, <CODE CLASS="parameter" >height</CODE >, and <CODE CLASS="parameter" >imagetype</CODE > all became available. </TD ></TR ><TR ><TD >4.3.0</TD ><TD > May return thumbnails in the <ACRONYM CLASS="acronym" >TIFF</ACRONYM > format. </TD ></TR ></TBODY ></TABLE ><P ></P ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN44950" ></A ><H2 >Exemplos</H2 ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN44953" ></A ><P ><B >Exemplo 1. <B CLASS="function" >exif_thumbnail()</B > example</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br /></font><font color="#007700">if (</font><font color="#0000BB">array_key_exists</font><font color="#007700">(</font><font color="#DD0000">'file'</font><font color="#007700">, </font><font color="#0000BB">$_REQUEST</font><font color="#007700">)) {<br /> </font><font color="#0000BB">$image </font><font color="#007700">= </font><font color="#0000BB">exif_thumbnail</font><font color="#007700">(</font><font color="#0000BB">$_REQUEST</font><font color="#007700">[</font><font color="#DD0000">'file'</font><font color="#007700">], </font><font color="#0000BB">$width</font><font color="#007700">, </font><font color="#0000BB">$height</font><font color="#007700">, </font><font color="#0000BB">$type</font><font color="#007700">);<br />} else {<br /> </font><font color="#0000BB">$image </font><font color="#007700">= </font><font color="#0000BB">false</font><font color="#007700">;<br />}<br />if (</font><font color="#0000BB">$image</font><font color="#007700">!==</font><font color="#0000BB">false</font><font color="#007700">) {<br /> </font><font color="#0000BB">header</font><font color="#007700">(</font><font color="#DD0000">'Content-type: ' </font><font color="#007700">.</font><font color="#0000BB">image_type_to_mime_type</font><font color="#007700">(</font><font color="#0000BB">$type</font><font color="#007700">));<br /> echo </font><font color="#0000BB">$image</font><font color="#007700">;<br /> exit;<br />} else {<br /> </font><font color="#FF8000">// no thumbnail available, handle the error here<br /> </font><font color="#007700">echo </font><font color="#DD0000">'No thumbnail available'</font><font color="#007700">;<br />}<br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN44957" ></A ><H2 >Veja também</H2 ><P > <P ></P ><TABLE BORDER="0" ><TBODY ><TR ><TD ><A HREF="function.exif-read-data.html" ><B CLASS="function" >exif_read_data()</B ></A ></TD ></TR ><TR ><TD ><A HREF="function.image-type-to-mime-type.html" ><B CLASS="function" >image_type_to_mime_type()</B ></A ></TD ></TR ></TBODY ></TABLE ><P ></P > </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-tagname.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Principal</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.read-exif-data.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >exif_tagname</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.exif.html" ACCESSKEY="U" >Acima</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >read_exif_data</TD ></TR ></TABLE ></DIV ></BODY ></HTML >