Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 3322

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Retrieve the embedded thumbnail of an image</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.exif-tagname.html">exif_tagname</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.read-exif-data.html">read_exif_data</a></div>
 <div class="up"><a href="ref.exif.html">Exif Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><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)</p><p class="refpurpose"><span class="refname">exif_thumbnail</span> &mdash; <span class="dc-title">Retrieve the embedded thumbnail of an 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="type">string</span> <span class="methodname"><strong>exif_thumbnail</strong></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$stream</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter reference">&$width</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter reference">&$height</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter reference">&$imagetype</code></span>
  ]]] )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>exif_thumbnail()</strong></span> reads the embedded thumbnail of an image. 
  </p>
  <p class="para">
   If you want to deliver thumbnails through this function, you should send
   the mimetype information using the <span class="function"><a href="function.header.html" class="function">header()</a></span> function.
  </p>
  <p class="para">
   It is possible that <span class="function"><strong>exif_thumbnail()</strong></span> cannot create an 
   image but can determine its size. In this case, the return value is 
   <strong><code>FALSE</code></strong> but <code class="parameter">width</code> and <code class="parameter">height</code> 
   are set.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.exif-thumbnail-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">stream</code></dt>

     <dd>

      <p class="para">
       The location of the image file. This can either be a path to the file 
       or a stream <span class="type"><a href="language.types.resource.html" class="type resource">resource</a></span>.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">width</code></dt>

     <dd>

      <p class="para">
       The return width of the returned thumbnail.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">height</code></dt>

     <dd>

      <p class="para">
       The returned height of the returned thumbnail.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">imagetype</code></dt>

     <dd>

      <p class="para">
       The returned image type of the returned thumbnail.  This is either
       <acronym title="Tagged Image File Format">TIFF</acronym> or <acronym title="Joint Photographic Experts Group">JPEG</acronym>.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.exif-thumbnail-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the embedded thumbnail, or <strong><code>FALSE</code></strong> if the image contains no 
   thumbnail.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.exif-thumbnail-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-3725">
    <p><strong>Example #1 <span class="function"><strong>exif_thumbnail()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$image&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">exif_thumbnail</span><span style="color: #007700">(</span><span style="color: #DD0000">'/path/to/image.jpg'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$width</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$height</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$type</span><span style="color: #007700">);<br /><br />if&nbsp;(</span><span style="color: #0000BB">$image</span><span style="color: #007700">!==</span><span style="color: #0000BB">false</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type:&nbsp;'&nbsp;</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 />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$image</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;exit;<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;no&nbsp;thumbnail&nbsp;available,&nbsp;handle&nbsp;the&nbsp;error&nbsp;here<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">'No&nbsp;thumbnail&nbsp;available'</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

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

     </thead>

     <tbody class="tbody">
      <tr>
       <td>7.2.0</td>
       <td>
        The <code class="parameter">filename</code> parameter was renamed to 
        <code class="parameter">stream</code> and now supports both local files 
        or stream resources.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </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>: 
   <p class="para">
    If the <code class="parameter">stream</code> is used to pass a stream to this function, then the stream 
    must be seekable. Note that the file pointer position is not changed after this function returns.
   </p>
  </p></blockquote>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.exif-thumbnail-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.exif-read-data.html" class="function" rel="rdfs-seeAlso">exif_read_data()</a> - Reads the EXIF headers from an image file</span></li>
    <li class="member"><span class="function"><a href="function.image-type-to-mime-type.html" class="function" rel="rdfs-seeAlso">image_type_to_mime_type()</a> - Get Mime-Type for image-type returned by getimagesize,
   exif_read_data, exif_thumbnail, exif_imagetype</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.exif-tagname.html">exif_tagname</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.read-exif-data.html">read_exif_data</a></div>
 <div class="up"><a href="ref.exif.html">Exif Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>