<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >Exif Functions</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="函数参考" HREF="funcref.html"><LINK REL="PREVIOUS" TITLE="user_error" HREF="function.user-error.html"><LINK REL="NEXT" TITLE="exif_imagetype" HREF="function.exif-imagetype.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="reference" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP 手册</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.user-error.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.exif-imagetype.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="reference" ><A NAME="ref.exif" ></A ><DIV CLASS="TITLEPAGE" ><H1 CLASS="title" >XXXIV. Exif Functions</H1 ><DIV CLASS="PARTINTRO" ><A NAME="AEN48057" ></A ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="exif.intro" >简介</A ></H1 ><P > With the exif extension you are able to work with image meta data. For example, you may use exif functions to read meta data of pictures taken from digital cameras by working with information stored in the headers of the <ACRONYM CLASS="acronym" >JPEG</ACRONYM > and <ACRONYM CLASS="acronym" >TIFF</ACRONYM > images. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="exif.requirements" >需求</A ></H1 ><P > Your PHP must be compiled in with <TT CLASS="literal" >--enable-exif</TT >. PHP does not require any additional library for the exif module. Windows users must also have the <A HREF="ref.mbstring.html" > mbstring</A > extension enabled. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="exif.installation" >安装</A ></H1 ><P > To enable exif-support configure PHP with <CODE CLASS="option" >--enable-exif</CODE > </P ><P > Windows users must enable both the <TT CLASS="filename" >php_mbstring.dll</TT > and <TT CLASS="filename" >php_exif.dll</TT > DLL's in <TT CLASS="filename" >php.ini</TT >. The <TT CLASS="filename" >php_mbstring.dll</TT > DLL must be loaded <SPAN CLASS="emphasis" ><I CLASS="emphasis" >before</I ></SPAN > the <TT CLASS="filename" >php_exif.dll</TT > DLL so adjust your <TT CLASS="filename" >php.ini</TT > accordingly. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="exif.configuration" >运行时配置</A ></H1 ><P >这些函数的行为受 <TT CLASS="filename" >php.ini</TT > 的影响。</P ><P > 当 <A HREF="ref.mbstring.html" >mbstring</A > 模块可用时,exif 支持用户注释中的 Unicode 和 JIS 字符编码的自动转换。这是通过先用指定字符集将注释解码,把结果再用另一个符合你的 <TT CLASS="literal" >HTTP</TT > 输出的字符集编码来实现的。 <DIV CLASS="table" ><A NAME="AEN48087" ></A ><P ><B >表 1. Exif configuration options</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><COL><COL><THEAD ><TR ><TH >名称</TH ><TH >默认值</TH ><TH >可修改范围</TH ><TH >更新记录</TH ></TR ></THEAD ><TBODY ><TR ><TD >exif.encode_unicode</TD ><TD >"ISO-8859-15"</TD ><TD >PHP_INI_ALL</TD ><TD >自 PHP 4.3.0 起可用。</TD ></TR ><TR ><TD >exif.decode_unicode_motorola</TD ><TD >"UCS-2BE"</TD ><TD >PHP_INI_ALL</TD ><TD >自 PHP 4.3.0 起可用。</TD ></TR ><TR ><TD >exif.decode_unicode_intel</TD ><TD >"UCS-2LE"</TD ><TD >PHP_INI_ALL</TD ><TD >自 PHP 4.3.0 起可用。</TD ></TR ><TR ><TD >exif.encode_jis</TD ><TD >""</TD ><TD >PHP_INI_ALL</TD ><TD >自 PHP 4.3.0 起可用。</TD ></TR ><TR ><TD >exif.decode_jis_motorola</TD ><TD >"JIS"</TD ><TD >PHP_INI_ALL</TD ><TD >自 PHP 4.3.0 起可用。</TD ></TR ><TR ><TD >exif.decode_jis_intel</TD ><TD >"JIS"</TD ><TD >PHP_INI_ALL</TD ><TD >自 PHP 4.3.0 起可用。</TD ></TR ></TBODY ></TABLE ></DIV > 有关 PHP_INI_* 常量进一步的细节与定义参见<A HREF="ini.html" >附录 H</A >。 </P ><P >以下是配置选项的简要解释。</P ><P > <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><A NAME="ini.exif.encode-unicode" ></A ><CODE CLASS="parameter" >exif.encode_unicode</CODE > <A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A ></DT ><DD ><P > <TT CLASS="literal" >exif.encode_unicode</TT > 定义了 UNICODE 用户注释被处理的字符集。默认为 ISO-8859-15,可用于大多数非亚洲国家。本设置可以为空或者必须为一个 mbstring 所支持的编码。如果为空,则使用当前 mbstring 内部使用的编码。 </P ></DD ><DT ><A NAME="ini.exif.decode-unicode-motorola" ></A ><CODE CLASS="parameter" >exif.decode_unicode_motorola</CODE > <A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A ></DT ><DD ><P > <TT CLASS="literal" >exif.decode_unicode_motorola</TT > 定义了 Unicode 编码的用户注释的图像内部字符集,如果图像是摩托罗拉字节顺序(big-endian)的话。本设置不能为空但可以指定一个 mbstring 支持的编码列表。默认为 UCS-2BE。 </P ></DD ><DT ><A NAME="ini.exif.decode-unicode-intel" ></A ><CODE CLASS="parameter" >exif.decode_unicode_intel</CODE > <A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A ></DT ><DD ><P > <TT CLASS="literal" >exif.decode_unicode_intel</TT > 定义了 Unicode 编码的用户注释的图像内部字符集,如果图像是英特尔字节顺序(little-endian)的话。本设置不能为空但可以指定一个 mbstring 支持的编码列表。默认为 UCS-2LE。 </P ></DD ><DT ><A NAME="ini.exif.encode-jis" ></A ><CODE CLASS="parameter" >exif.encode_jis</CODE > <A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A ></DT ><DD ><P > <TT CLASS="literal" >exif.encode_jis</TT > 定义了 JIS 用户注释被处理的字符集。默认为空值,迫使函数使用当前 mbstring 使用的内部编码。 </P ></DD ><DT ><A NAME="ini.exif.decode-jis-motorola" ></A ><CODE CLASS="parameter" >exif.decode_jis_motorola</CODE > <A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A ></DT ><DD ><P > <TT CLASS="literal" >exif.decode_jis_motorola</TT > 定义了 JIS 编码的用户注释的图像内部字符集,如果图像是摩托罗拉字节顺序(big-endian)的话。本设置不能为空但可以指定一个 mbstring 支持的编码列表。默认为 JIS。 </P ></DD ><DT ><A NAME="ini.exif.decode-jis-intel" ></A ><CODE CLASS="parameter" >exif.decode_jis_intel</CODE > <A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A ></DT ><DD ><P > <TT CLASS="literal" >exif.decode_jis_intel</TT > 定义了 JIS 编码的用户注释的图像内部字符集,如果图像是英特尔字节顺序(litle-endian)的话。本设置不能为空但可以指定一个 mbstring 支持的编码列表。默认为 JIS。 </P ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="exif.resources" >资源类型</A ></H1 ><P >本扩展模块未定义任何资源类型。</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="exif.constants" >预定义常量</A ></H1 ><P >以下常量由本扩展模块定义,因此只有在本扩展模块被编译到 PHP 中,或者在运行时被动态加载后才有效。</P ><P > <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><TT CLASS="constant" ><B >EXIF_USE_MBSTRING</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > </P ></DD ></DL ></DIV > </P ><P > The <A HREF="function.exif-imagetype.html" ><B CLASS="function" >exif_imagetype()</B ></A > lists several related built-in constants. </P ></DIV ></DIV ><DIV CLASS="TOC" ><DL ><DT ><B >目录</B ></DT ><DT ><A HREF="function.exif-imagetype.html" >exif_imagetype</A > -- 判断一个图像的类型</DT ><DT ><A HREF="function.exif-read-data.html" >exif_read_data</A > -- 从 <ACRONYM CLASS="acronym" >JPEG</ACRONYM > 或 <ACRONYM CLASS="acronym" >TIFF</ACRONYM > 文件中读取 <ACRONYM CLASS="acronym" >EXIF</ACRONYM > 头信息 </DT ><DT ><A HREF="function.exif-tagname.html" >exif_tagname</A > -- Get the header name for an index</DT ><DT ><A HREF="function.exif-thumbnail.html" >exif_thumbnail</A > -- 取得嵌入在 TIFF 或 JPEG 图像中的缩略图</DT ><DT ><A HREF="function.read-exif-data.html" >read_exif_data</A > -- <A HREF="function.exif-read-data.html" ><B CLASS="function" >exif_read_data()</B ></A > 的别名</DT ></DL ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.user-error.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >起始页</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.exif-imagetype.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >user_error</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="funcref.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >exif_imagetype</TD ></TR ></TABLE ></DIV ></BODY ></HTML >