function.exif-read-data.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 348 行 · 第 1/2 页

HTML
348
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Reads the EXIF headers from JPEG or TIFF</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.exif-imagetype.html">exif_imagetype</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.exif-tagname.html">exif_tagname</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-read-data" class="refentry"> <div class="refnamediv">  <h1 class="refname">exif_read_data</h1>  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5)</p><p class="refpurpose"><span class="refname">exif_read_data</span> &mdash; <span class="dc-title">Reads the <acronym title="Exchangeable Image File ">EXIF</acronym> headers from <acronym title="Joint Photographic Experts Group">JPEG</acronym> or <acronym title="Tagged Image File Format">TIFF</acronym></span></p> </div> <div class="refsect1 description">  <h3 class="title">Description</h3>  <div class="methodsynopsis dc-description">   <span class="type">array</span> <span class="methodname"><b><b>exif_read_data</b></b></span>    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$filename</tt></span>   [, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$sections</tt></span>   [, <span class="methodparam"><span class="type">bool</span> <tt class="parameter">$arrays</tt></span>   [, <span class="methodparam"><span class="type">bool</span> <tt class="parameter">$thumbnail</tt></span>  ]]] )</div>  <p class="para rdfs-comment">   <b>exif_read_data()</b> reads the   <acronym title="Exchangeable Image File ">EXIF</acronym> headers from a <acronym title="Joint Photographic Experts Group">JPEG</acronym> or    <acronym title="Tagged Image File Format">TIFF</acronym> image file.  This way you can read meta data    generated by digital cameras.  </p>  <p class="para">   Exif headers tend to be present in JPEG/TIFF images generated by digital   cameras, but unfortunately each digital camera maker has a different   idea of how to actually tag their images, so you can&#039;t always rely on   a specific Exif header being present.  </p>  <p class="para">   <i>Height</i> and <i>Width</i> are computed the    same way <a href="function.getimagesize.html" class="function">getimagesize()</a> does so their values must not be    part of any header returned.  Also, <i>html</i> is a    height/width text string to be used inside normal <acronym title="Hyper Text Markup Language">HTML</acronym>.  </p>  <p class="para">   When an Exif header contains a Copyright note, this itself can contain two   values. As the solution is inconsistent in the Exif 2.10 standard, the COMPUTED   section will return both entries <i>Copyright.Photographer</i>   and <i>Copyright.Editor</i> while the IFD0 sections contains   the byte array with the NULL character that splits both entries. Or just the   first entry if the datatype was wrong (normal behaviour of Exif). The   COMPUTED will also contain the entry <i>Copyright</i> which   is either the original copyright string, or a comma separated list of the    photo and editor copyright.  </p>  <p class="para">   The tag UserComment has the same problem as the Copyright tag. It can store   two values.  First the encoding used, and second the value itself. If so the   IFD section only contains the encoding or a byte array. The COMPUTED section   will store both in the entries <i>UserCommentEncoding</i> and   <i>UserComment</i>. The entry <i>UserComment</i>   is available in both cases so it should be used in preference to the value   in IFD0 section.  </p>  <p class="para">   <b>exif_read_data()</b> also validates EXIF data tags according   to the EXIF specification (<a href="http://exif.org/Exif2-2.PDF" class="link external">&raquo; http://exif.org/Exif2-2.PDF</a>, page 20).  </p>  <blockquote><p><b class="note">Note</b>:        Windows ME/XP can both wipe the Exif headers when connecting to a camera.    More information available at <a href="http://www.canon.co.jp/Imaging/NOTICE/011214-e.html" class="link external">&raquo; http://www.canon.co.jp/Imaging/NOTICE/011214-e.html</a>.   <br />  </p></blockquote> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt>     <span class="term"><i><tt class="parameter">filename</tt></i></span>     <dd>      <p class="para">       The name of the image file being read.  This cannot be an       <acronym title="Uniform Resource Locator">URL</acronym>.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">sections</tt></i></span>     <dd>      <p class="para">       Is a comma separated list of sections that need to be present in file        to produce a result <a href="language.types.array.html" class="type array">array</a>.  If none of the requested        sections could be found the return value is <b><tt>FALSE</tt></b>.       <table class="informaltable">        <colgroup>         <tbody valign="middle" class="tbody">          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">FILE</td>           <td colspan="1" rowspan="1" align="left">FileName, FileSize, FileDateTime, SectionsFound</td>          </tr>          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">COMPUTED</td>           <td colspan="1" rowspan="1" align="left">            html, Width, Height, IsColor, and more if available.  Height and             Width are computed the same way <a href="function.getimagesize.html" class="function">getimagesize()</a>            does so their values must not be part of any header returned.             Also, html is a height/width text string to be used inside normal             <acronym title="Hyper Text Markup Language">HTML</acronym>.           </td>          </tr>          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">ANY_TAG</td>           <td colspan="1" rowspan="1" align="left">Any information that has a Tag e.g. IFD0, EXIF, ...</td>          </tr>          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">IFD0</td>           <td colspan="1" rowspan="1" align="left">            All tagged data of IFD0. In normal imagefiles this contains            image size and so forth.           </td>          </tr>          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">THUMBNAIL</td>           <td colspan="1" rowspan="1" align="left">            A file is supposed to contain a thumbnail if it has a second IFD.            All tagged information about the embedded thumbnail is stored in             this section.           </td>          </tr>          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">COMMENT</td>           <td colspan="1" rowspan="1" align="left">Comment headers of JPEG images.</td>          </tr>          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">EXIF</td>           <td colspan="1" rowspan="1" align="left">            The EXIF section is a sub section of IFD0. It contains            more detailed information about an image. Most of these entries            are digital camera related.           </td>          </tr>         </tbody>        </colgroup>       </table>      </p>     </dd>    </dt>    <dt>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?