<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.image.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.image-type-to-mime-type.php',
    1 => 'image_type_to_mime_type',
    2 => 'Get Mime-Type for image-type returned by getimagesize,
   exif_read_data, exif_thumbnail, exif_imagetype',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'GD and Image Functions',
  ),
  'prev' => 
  array (
    0 => 'function.image-type-to-extension.php',
    1 => 'image_type_to_extension',
  ),
  'next' => 
  array (
    0 => 'function.image2wbmp.php',
    1 => 'image2wbmp',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/image/functions/image-type-to-mime-type.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.image-type-to-mime-type" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">image_type_to_mime_type</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">image_type_to_mime_type</span> &mdash; <span class="dc-title">Get Mime-Type for image-type returned by getimagesize,
   exif_read_data, exif_thumbnail, exif_imagetype</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.image-type-to-mime-type-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>image_type_to_mime_type</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$image_type</code></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="para rdfs-comment">
   The <span class="function"><strong>image_type_to_mime_type()</strong></span> function will determine
   the Mime-Type for an IMAGETYPE constant.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.image-type-to-mime-type-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">image_type</code></dt>
     <dd>
      <p class="para">
       One of the <strong><code><a href="image.constants.php#constant.imagetype-gif">IMAGETYPE_<span class="replaceable">*</span></a></code></strong> constants.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.image-type-to-mime-type-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   The returned values are as follows
   <table class="doctable table">
   <caption><strong>Returned values Constants</strong></caption>
    
     <thead>
      <tr>
       <th><code class="parameter">image_type</code></th>
       <th>Returned value</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-gif">IMAGETYPE_GIF</a></code></strong></td>
       <td><code class="literal">image/gif</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-jpeg">IMAGETYPE_JPEG</a></code></strong></td>
       <td><code class="literal">image/jpeg</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-png">IMAGETYPE_PNG</a></code></strong></td>
       <td><code class="literal">image/png</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-swf">IMAGETYPE_SWF</a></code></strong></td>
       <td><code class="literal">application/x-shockwave-flash</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-psd">IMAGETYPE_PSD</a></code></strong></td>
       <td><code class="literal">image/psd</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-bmp">IMAGETYPE_BMP</a></code></strong></td>
       <td><code class="literal">image/bmp</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-tiff-ii">IMAGETYPE_TIFF_II</a></code></strong> (intel byte order)</td>
       <td><code class="literal">image/tiff</code></td>
      </tr>

      <tr>
       <td>
        <strong><code><a href="image.constants.php#constant.imagetype-tiff-mm">IMAGETYPE_TIFF_MM</a></code></strong> (motorola byte order)
       </td>
       <td><code class="literal">image/tiff</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-jpc">IMAGETYPE_JPC</a></code></strong></td>
       <td><code class="literal">application/octet-stream</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-jp2">IMAGETYPE_JP2</a></code></strong></td>
       <td><code class="literal">image/jp2</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-jpx">IMAGETYPE_JPX</a></code></strong></td>
       <td><code class="literal">application/octet-stream</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-jb2">IMAGETYPE_JB2</a></code></strong></td>
       <td><code class="literal">application/octet-stream</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-swc">IMAGETYPE_SWC</a></code></strong></td>
       <td><code class="literal">application/x-shockwave-flash</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-iff">IMAGETYPE_IFF</a></code></strong></td>
       <td><code class="literal">image/iff</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-wbmp">IMAGETYPE_WBMP</a></code></strong></td>
       <td><code class="literal">image/vnd.wap.wbmp</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-xbm">IMAGETYPE_XBM</a></code></strong></td>
       <td><code class="literal">image/xbm</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-ico">IMAGETYPE_ICO</a></code></strong></td>
       <td><code class="literal">image/vnd.microsoft.icon</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-webp">IMAGETYPE_WEBP</a></code></strong></td>
       <td><code class="literal">image/webp</code></td>
      </tr>

      <tr>
       <td><strong><code><a href="image.constants.php#constant.imagetype-avif">IMAGETYPE_AVIF</a></code></strong></td>
       <td><code class="literal">image/avif</code></td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.image-type-to-mime-type-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="function"><strong>image_type_to_mime_type()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />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">IMAGETYPE_PNG</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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


 <div class="refsect1 notes" id="refsect1-function.image-type-to-mime-type-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para">This function does not require the GD image library.</p></p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.image-type-to-mime-type-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.getimagesize.php" class="function" rel="rdfs-seeAlso">getimagesize()</a> - Get the size of an image</span></li>
   <li><span class="function"><a href="function.exif-imagetype.php" class="function" rel="rdfs-seeAlso">exif_imagetype()</a> - Determine the type of an image</span></li>
   <li><span class="function"><a href="function.exif-read-data.php" class="function" rel="rdfs-seeAlso">exif_read_data()</a> - Reads the EXIF headers from an image file</span></li>
   <li><span class="function"><a href="function.exif-thumbnail.php" class="function" rel="rdfs-seeAlso">exif_thumbnail()</a> - Retrieve the embedded thumbnail of an image</span></li>
  </ul>
 </div>

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