<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.exif.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.exif-thumbnail.php',
    1 => 'exif_thumbnail',
    2 => 'R&eacute;cup&egrave;re la miniature d\'une image',
  ),
  'up' => 
  array (
    0 => 'ref.exif.php',
    1 => 'Fonctions Exif',
  ),
  'prev' => 
  array (
    0 => 'function.exif-tagname.php',
    1 => 'exif_tagname',
  ),
  'next' => 
  array (
    0 => 'function.read-exif-data.php',
    1 => 'read_exif_data',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/exif/functions/exif-thumbnail.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.exif-thumbnail" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">exif_thumbnail</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">exif_thumbnail</span> &mdash; <span class="dc-title">Récupère la miniature d&#039;une image</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.exif-thumbnail-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>exif_thumbnail</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$file</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter reference">&$width</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter reference">&$height</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter reference">&$image_type</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span><br>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="simpara">
   <span class="function"><strong>exif_thumbnail()</strong></span> lit la miniature de l&#039;image.
  </p>
  <p class="simpara">
   Pour afficher des miniatures avec cette fonction, il faut
   envoyer le bon type MIME avec la fonction <span class="function"><a href="function.header.php" class="function">header()</a></span>.
  </p>
  <p class="simpara">
   Il est possible que la fonction <span class="function"><strong>exif_thumbnail()</strong></span>
   n&#039;arrive pas à créer l&#039;image mais peut déterminer sa taille. Dans ce cas, la fonction
   retourne <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> mais les paramètres <code class="parameter">width</code> et
   <code class="parameter">height</code> sont définis.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.exif-thumbnail-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <dl>
   
    <dt><code class="parameter">file</code></dt>
    <dd>
     <span class="simpara">
      Localisation du fichier image. Il peut s&#039;agir soit d&#039;un chemin d&#039;accès
      au fichier, soit d&#039;un flux <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>.
     </span>
    </dd>
   
   
    <dt><code class="parameter">width</code></dt>
    <dd>
     <span class="simpara">
      La largeur de la miniature retournée.
     </span>
    </dd>
   
   
    <dt><code class="parameter">height</code></dt>
    <dd>
     <span class="simpara">
      La hauteur de la miniature retournée.
     </span>
    </dd>
   
   
    <dt><code class="parameter">image_type</code></dt>
    <dd>
     <span class="simpara">
      Le type de l&#039;image de la miniature retournée. Peut être
      soit <abbr title="Tagged Image File Format">TIFF</abbr>, soit <abbr title="Joint Photographic Experts Group">JPEG</abbr>.
     </span>
    </dd>
   
  </dl>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.exif-thumbnail-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="simpara">
   Retourne la miniature embarquée ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si l&#039;image ne contient pas
   de miniature.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.exif-thumbnail-changelog">
  <h3 class="title">Historique</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>7.2.0</td>
      <td>
       Le paramètre <code class="parameter">file</code> supporte les fichiers
       locaux ou les ressources de flux.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.exif-thumbnail-examples">
  <h3 class="title">Exemples</h3>
  <div class="example" id="example-1">
   <p><strong>Exemple #1 Exemple avec <span class="function"><strong>exif_thumbnail()</strong></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">if (</span><span style="color: #0000BB">array_key_exists</span><span style="color: #007700">(</span><span style="color: #DD0000">'file'</span><span style="color: #007700">, </span><span style="color: #0000BB">$_REQUEST</span><span style="color: #007700">)) {<br />    </span><span style="color: #0000BB">$image </span><span style="color: #007700">= </span><span style="color: #0000BB">exif_thumbnail</span><span style="color: #007700">(</span><span style="color: #0000BB">$_REQUEST</span><span style="color: #007700">[</span><span style="color: #DD0000">'file'</span><span style="color: #007700">], </span><span style="color: #0000BB">$width</span><span style="color: #007700">, </span><span style="color: #0000BB">$height</span><span style="color: #007700">, </span><span style="color: #0000BB">$type</span><span style="color: #007700">);<br />} else {<br />    </span><span style="color: #0000BB">$image </span><span style="color: #007700">= </span><span style="color: #0000BB">false</span><span style="color: #007700">;<br />}<br />if (</span><span style="color: #0000BB">$image</span><span style="color: #007700">!==</span><span style="color: #0000BB">false</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type: ' </span><span style="color: #007700">.</span><span style="color: #0000BB">image_type_to_mime_type</span><span style="color: #007700">(</span><span style="color: #0000BB">$type</span><span style="color: #007700">));<br />    echo </span><span style="color: #0000BB">$image</span><span style="color: #007700">;<br />    exit;<br />} else {<br />    </span><span style="color: #FF8000">// aucune miniature de disponible, traitement de l'erreur ici<br />    </span><span style="color: #007700">echo </span><span style="color: #DD0000">'No thumbnail available'</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 notes" id="refsect1-function.exif-thumbnail-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <span class="simpara">
    Si le paramètre <code class="parameter">file</code> est utilisé pour passer un
    flux à la fonction, alors le flux doit être repositionnable. Il est à noter que la
    position du pointeur d&#039;un fichier n&#039;est pas modifiée après le retour de
    cette fonction.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.exif-thumbnail-seealso">
  <h3 class="title">Voir aussi</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.exif-read-data.php" class="function" rel="rdfs-seeAlso">exif_read_data()</a> - Lit les en-t&ecirc;tes EXIF dans les images</span></li>
   <li><span class="function"><a href="function.image-type-to-mime-type.php" class="function" rel="rdfs-seeAlso">image_type_to_mime_type()</a> - Lit le Mime-Type d'un type d'image</span></li>
  </ul>
 </div>

</div><?php manual_footer($setup); ?>