<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.image-type-to-mime-type" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>image_type_to_mime_type</refname>
  <refpurpose>Get Mime-Type for image-type returned by getimagesize,
   exif_read_data, exif_thumbnail, exif_imagetype</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>string</type><methodname>image_type_to_mime_type</methodname>
   <methodparam><type>int</type><parameter>image_type</parameter></methodparam>
  </methodsynopsis>
  <para>
   The <function>image_type_to_mime_type</function> function will determine
   the Mime-Type for an IMAGETYPE constant.
  </para>
 </refsect1>
 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>image_type</parameter></term>
     <listitem>
      <para>
       One of the <literal>IMAGETYPE_XXX</literal> constants.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   The returned values are as follows
   <table>
   <title>Returned values Constants</title>
    <tgroup cols="2">
     <thead>
      <row>
       <entry><parameter>image_type</parameter></entry>
       <entry>Returned value</entry>
      </row>
     </thead>
     <tbody>
      <row>
       <entry><constant>IMAGETYPE_GIF</constant></entry>
       <entry><literal>image/gif</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_JPEG</constant></entry>
       <entry><literal>image/jpeg</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_PNG</constant></entry>
       <entry><literal>image/png</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_SWF</constant></entry>
       <entry><literal>application/x-shockwave-flash</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_PSD</constant></entry>
       <entry><literal>image/psd</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_BMP</constant></entry>
       <entry><literal>image/bmp</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_TIFF_II</constant> (intel byte order)</entry>
       <entry><literal>image/tiff</literal></entry>
      </row>
      <row>
       <entry>
        <constant>IMAGETYPE_TIFF_MM</constant> (motorola byte order)
       </entry>
       <entry><literal>image/tiff</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_JPC</constant></entry>
       <entry><literal>application/octet-stream</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_JP2</constant></entry>
       <entry><literal>image/jp2</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_JPX</constant></entry>
       <entry><literal>application/octet-stream</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_JB2</constant></entry>
       <entry><literal>application/octet-stream</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_SWC</constant></entry>
       <entry><literal>application/x-shockwave-flash</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_IFF</constant></entry>
       <entry><literal>image/iff</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_WBMP</constant></entry>
       <entry><literal>image/vnd.wap.wbmp</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_XBM</constant></entry>
       <entry><literal>image/xbm</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_ICO</constant></entry>
       <entry><literal>image/vnd.microsoft.icon</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_WEBP</constant></entry>
       <entry><literal>image/webp</literal></entry>
      </row>
      <row>
       <entry><constant>IMAGETYPE_AVIF</constant></entry>
       <entry><literal>image/avif</literal></entry>
      </row>
     </tbody>
    </tgroup>
   </table>
  </para>
 </refsect1>
 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title><function>image_type_to_mime_type</function> example</title>
    <programlisting role="php">
<![CDATA[
<?php
header("Content-type: " . image_type_to_mime_type(IMAGETYPE_PNG));
?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>

 <refsect1 role="notes">
  &reftitle.notes;
  &note.gd.notrequired;
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <simplelist>
   <member><function>getimagesize</function></member>
   <member><function>exif_imagetype</function></member>
   <member><function>exif_read_data</function></member>
   <member><function>exif_thumbnail</function></member>
  </simplelist>
 </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
