cvs: phpdoc-zh /reference/exif/functions exif-imagetype.xml exif-read-data.xml exif-thumbnail.xml read-exif-data.xml
| From: | Xiao shengwen | Date: | Thu, 07 Jul 2005 10:18:40 +0000 |
| Subject: | cvs: phpdoc-zh /reference/exif/functions exif-imagetype.xml exif-read-data.xml exif-thumbnail.xml read-exif-data.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-2014@lists.php.net to get a copy of this message | ||
yincheng Thu Jul 7 06:18:40 2005 EDT
Added files:
/phpdoc-zh/reference/exif/functions exif-imagetype.xml
exif-read-data.xml
exif-thumbnail.xml
read-exif-data.xml
Log:
Ŀ¼·ÖÀ룬´ÓimageĿ¼¿½±´
http://cvs.php.net/co.php/phpdoc-zh/reference/exif/functions/exif-imagetype.xml?r=1.1&p=1 Index: phpdoc-zh/reference/exif/functions/exif-imagetype.xml +++ phpdoc-zh/reference/exif/functions/exif-imagetype.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: yincheng $ --> <!-- EN-Revision: 1.13 Maintainer: dallas Status: ready --> <refentry id="function.exif-imagetype"> <refnamediv> <refname>exif_imagetype</refname> <refpurpose>ÅжÏÒ»¸öͼÏñµÄÀàÐÍ</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>int</type><methodname>exif_imagetype</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> </methodsynopsis> <para> <function>exif_imagetype</function> ¶Áȡһ¸öͼÏñµÄµÚÒ»¸ö×Ö½Ú²¢¼ì²éÆäÇ©Ãû¡£Èç¹û·¢ÏÖÁËÇ¡µ±µÄÇ©ÃûÔò·µ»ØÒ»¸ö³£Á¿£¬·ñÔò·µ»Ø &false;¡£·µ»ØÖµºÍ <function>getimagesize</function> ·µ»ØµÄÊý×éÖеÄË÷Òý 2 µÄÖµÊÇÒ»ÑùµÄ£¬µ«±¾º¯Êý¿ìµÃ¶à¡£ </para> <para> ¶¨ÒåÓÐÒÔϳ£Á¿£º <table> <title>ͼÏñÀàÐͳ£Á¿</title> <tgroup cols="2"> <thead> <row> <entry>Öµ</entry> <entry>³£Á¿</entry> </row> </thead> <tbody> <row> <entry>1</entry> <entry><constant>IMAGETYPE_GIF</constant></entry> </row> <row> <entry>2</entry> <entry><constant>IMAGETYPE_JPEG</constant></entry> </row> <row> <entry>3</entry> <entry><constant>IMAGETYPE_PNG</constant></entry> </row> <row> <entry>4</entry> <entry><constant>IMAGETYPE_SWF</constant></entry> </row> <row> <entry>5</entry> <entry><constant>IMAGETYPE_PSD</constant></entry> </row> <row> <entry>6</entry> <entry><constant>IMAGETYPE_BMP</constant></entry> </row> <row> <entry>7</entry> <entry><constant>IMAGETYPE_TIFF_II</constant> (intel byte order)</entry> </row> <row> <entry>8</entry> <entry> <constant>IMAGETYPE_TIFF_MM</constant> (motorola byte order) </entry> </row> <row> <entry>9</entry> <entry><constant>IMAGETYPE_JPC</constant></entry> </row> <row> <entry>10</entry> <entry><constant>IMAGETYPE_JP2</constant></entry> </row> <row> <entry>11</entry> <entry><constant>IMAGETYPE_JPX</constant></entry> </row> <row> <entry>12</entry> <entry><constant>IMAGETYPE_JB2</constant></entry> </row> <row> <entry>13</entry> <entry><constant>IMAGETYPE_SWC</constant></entry> </row> <row> <entry>14</entry> <entry><constant>IMAGETYPE_IFF</constant></entry> </row> <row> <entry>15</entry> <entry><constant>IMAGETYPE_WBMP</constant></entry> </row> <row> <entry>16</entry> <entry><constant>IMAGETYPE_XBM</constant></entry> </row> </tbody> </tgroup> </table> </para> <note> <para> ¶Ô <acronym>JPC</acronym>£¬<acronym>JP2</acronym>£¬<acronym>JPX</acronym>£¬<acronym>JB2</acronym>£¬<acronym>XBM</acronym> ºÍ <acronym>WBMP</acronym> µÄÖ§³Ö×Ô PHP 4.3.2 Æð¿ÉÓá£¶Ô <acronym>SWC</acronym> µÄÖ§³Ö×Ô PHP 4.3.0 Æð¿ÉÓᣠ</para> </note> <para> ±¾º¯Êý¿ÉÓÃÀ´±ÜÃâµ÷ÓÃÆäËü exif º¯ÊýÓõ½Á˲»Ö§³ÖµÄÎļþÀàÐÍÉÏ»òºÍ <varname>$_SERVER['HTTP_ACCEPT']</varname> ½áºÏʹÓÃÀ´¼ì²éä¯ÀÀÆ÷ÊÇ·ñ¿ÉÒÔÏÔʾij¸öÖ¸¶¨µÄͼÏñ¡£ </para> <note> <simpara> ±¾º¯Êý½öÔÚ PHP ±àÒëʱʹÓÃÁË <option role="configure">--enable-exif</option> Ñ¡Ïîʱ¿ÉÓᣠ</simpara> </note> <note> <simpara> ±¾º¯Êý²»ÐèÒª GD ͼÏñ¿â¡£ </simpara> </note> <example> <title><function>exif_imagetype</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php if (exif_imagetype("image.gif") != IMAGETYPE_GIF) { echo "The picture is not a gif"; } ?> ]]> </programlisting> </example> <simpara> ²Î¼û <function>getimagesize</function>¡£ </simpara> </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-zh/reference/exif/functions/exif-read-data.xml?r=1.1&p=1 Index: phpdoc-zh/reference/exif/functions/exif-read-data.xml +++ phpdoc-zh/reference/exif/functions/exif-read-data.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: yincheng $ --> <!-- EN-Revision: 1.15 Maintainer: dallas Status: ready --> <refentry id="function.exif-read-data"> <refnamediv> <refname>exif_read_data</refname> <refpurpose> ´Ó <acronym>JPEG</acronym> »ò <acronym>TIFF</acronym> ÎļþÖжÁÈ¡ <acronym>EXIF</acronym> Í·ÐÅÏ¢£¬ÕâÑù¾Í¿ÉÒÔ¶ÁÈ¡ÊýÂëÏà»ú²úÉúµÄÔªÊý¾Ý </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>array</type><methodname>exif_read_data</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>sections</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>arrays</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>thumbnail</parameter></methodparam> </methodsynopsis> <para> <function>exif_read_data</function> º¯Êý´Ó JPEG »ò TIFF ͼÏñÎļþÖжÁÈ¡ EXIF Í·ÐÅÏ¢¡£·µ»ØÒ»¸ö¹ØÁªÊý×飬¼üÃûÊÇÍ·ÐÅÏ¢Ãû£¬ÖµÎªÓëÆäÏàÓ¦µÄÖµ¡£Èç¹ûûÓпɹ©·µ»ØµÄÊý¾ÝÔò·µ»Ø &false;¡£ </para> <para> <parameter>filename</parameter> ÊDZ»¶ÁÈ¡µÄÎļþÃû¡£²»ÄÜÊÇ URL¡£ </para> <para> <parameter>sections</parameter> ÊÇÐèÒª´æÔÚÓÚÎļþÖеĶººÅ·Ö¸ôµÄÇø¶ÎÁбíÓÃÀ´²úÉú½á¹ûÊý×é¡£Èç¹ûδÕÒµ½ËùÇëÇóµÄÇø¶ÎÔò·µ»ØÖµÎª &false;¡£ <informaltable> <tgroup cols="2"> <tbody> <row> <entry>FILE</entry> <entry>FileName£¬FileSize£¬FileDateTime£¬SectionsFound</entry> </row> <row> <entry>COMPUTED</entry> <entry>html£¬Width£¬Height£¬IsColor£¬¿ÉÄÜÓиü¶àÆäËüµÄ¡£ </entry> </row> <row> <entry>ANY_TAG</entry> <entry>ÈκÎÓбê¼ÇµÄÐÅÏ¢£¬ÀýÈç IFD0£¬EXIF£¬...</entry> </row> <row> <entry>IFD0</entry> <entry> ËùÓÐ IFD0 µÄ±ê¼ÇÊý¾Ý¡£ÔÚ±ê×¼µÄͼÏñÎļþÖÐÕâ°üº¬ÁËͼÏñ´óС¼°ÆäËü¡£ </entry> </row> <row> <entry>THUMBNAIL</entry> <entry> Èç¹ûÓеڶþ¸ö IFD£¬ÎļþÓ¦¸Ã°üº¬ÓÐËõÂÔͼ¡£ËùÓÐÓйØÇ¶ÈëËõÂÔͼµÄ±ê¼ÇÐÅÏ¢¶¼´æ´¢ÔÚ±¾Çø¡£ </entry> </row> <row> <entry>COMMENT</entry> <entry>JPEG ͼÏñµÄ×¢ÊÍÍ·ÐÅÏ¢¡£</entry> </row> <row> <entry>EXIF</entry> <entry> EXIF Çø¶ÎÊÇ IFDO µÄ×ÓÇø£¬°üº¬ÓÐͼÏñµÄ¸ü¶àÏêϸÐÅÏ¢¡£´ó¶àÊýÄÚÈݶ¼ÊÇÊýÂëÏà»úÏà¹ØµÄ¡£ </entry> </row> </tbody> </tgroup> </informaltable> </para> <para> <parameter>arrays</parameter> Ö¸¶¨ÁËÊÇ·ñÿ¸öÇø¶Î¶¼³ÉΪһ¸öÊý×é¡£<emphasis>COMPUTED</emphasis> ºÍ <emphasis>THUMBNAIL</emphasis> Çø¶Î×ÜÊdzÉΪÊý×飬ÒòΪËüÃÇÀïÃæ°üº¬µÄÃû×ÖºÍÆäËüÇø¶Î³åÍ»¡£ </para> <para> <parameter>thumbnail</parameter> Ö¸¶¨ÁËÊÇ·ñ¶ÁÈ¡ËõÂÔͼ±¾Éí¶ø²»Ö»ÊDZê¼ÇÊý¾Ý¡£ </para> <note> <para> Exif Í·ÐÅÏ¢ÍùÍù´æÔÚÓÚÊýÂëÏà»úÉú³ÉµÄ JPEG/TIFF ͼÏñÖУ¬µ«²»ÐÒµÄÊÇÿ¸öÊýÂëÏà»úÖÆÔìÉ̵ıê¼Ç¶¼²»Í¬£¬Òò´Ë£¨±àд´úÂëʱ£©²»ÄÜÒÀÀµÓÚij¸öÌØ¶¨µÄ Exif Í·ÐÅÏ¢¡£ </para> <para> Windows ME/XP ÔÚÁ¬½Óµ½ÊýÂëÏà»úʱÄÜÇå³ýµô Exif Í·ÐÅÏ¢¡£¸ü¶àÐÅÏ¢¼û <ulink url="&url.winexif;">&url.winexif;</ulink>¡£ </para> </note> <para> <example> <title><function>exif_read_data</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php echo "test1.jpg:<br />\n"; $exif = exif_read_data ('tests/test1.jpg','IFD0'); echo $exif===false ? "No header data found.<br />\n" : "Image contains headers<br />"; $exif = exif_read_data ('tests/test2.jpg',0,true); echo "test2.jpg:<br />\n"; foreach($exif as $key=>$section) { foreach($section as $name=>$val) { echo "$key.$name: $val<br />\n"; } } ?> ]]> </programlisting> <para> µÚÒ»¸öµ÷ÓÃʧ°ÜÁË£¬ÒòΪͼÏñûÓÐÍ·ÐÅÏ¢¡£ <screen role="php"> <![CDATA[ test1.jpg: No header data found. test2.jpg: FILE.FileName: test2.jpg FILE.FileDateTime: 1017666176 FILE.FileSize: 1240 FILE.FileType: 2 FILE.SectionsFound: ANY_TAG, IFD0, THUMBNAIL, COMMENT COMPUTED.html: width="1" height="1" COMPUTED.Height: 1 COMPUTED.Width: 1 COMPUTED.IsColor: 1 COMPUTED.ByteOrderMotorola: 1 COMPUTED.UserComment: Exif test image. COMPUTED.UserCommentEncoding: ASCII COMPUTED.Copyright: Photo (c) M.Boerger, Edited by M.Boerger. COMPUTED.Copyright.Photographer: Photo (c) M.Boerger COMPUTED.Copyright.Editor: Edited by M.Boerger. IFD0.Copyright: Photo (c) M.Boerger IFD0.UserComment: ASCII THUMBNAIL.JPEGInterchangeFormat: 134 THUMBNAIL.JPEGInterchangeFormatLength: 523 COMMENT.0: Comment #1. COMMENT.1: Comment #2. COMMENT.2: Comment #3end THUMBNAIL.JPEGInterchangeFormat: 134 THUMBNAIL.Thumbnail.Height: 1 THUMBNAIL.Thumbnail.Height: 1 ]]> </screen> </para> </example> </para> <note> <para> Èç¹ûͼÏñ°üº¬ÈκΠIFD0 Êý¾Ý£¬Ôò COMPUTED »á°üº¬ÓÐÒ»Ïî ByteOrderMotorola£¬¶ÔÓÚ little-endian (intel) ×Ö½Ú˳Ðò£¬ÆäֵΪ 0£¬¶ÔÓÚ big-endian (motorola) ×Ö½Ú˳Ðò£¬ÆäֵΪ 1¡£ÕâÊÇ PHP 4.3 мӵġ£ </para> <para> µ±Ò»¸ö Exif Í·ÐÅÏ¢°üº¬ÓÐÒ»¸ö Copyright ʱעÒâËü±¾Éí¿ÉÒÔ°üº¬Á½¸öÖµ¡£½â¾ö·½°¸ºÍ Exif 2.10 ±ê×¼²»Ò»Ö£¬COMPUTED Çø¶Î»áͬʱ·µ»Ø <emphasis>Copyright.Photographer</emphasis> ºÍ <emphasis>Copyright.Editor</emphasis>£¬µ«ÊÇ IFD0 Çø¶ÎÔò°üº¬ÓÐÒ»¸ö×Ö½ÚÊý×éÓà NULL ×Ö·û·Ö¸ô¿ªÁ½¸öÏîÄ¿¡£»òÕßÖ»ÓеÚÒ»ÏîÈç¹ûÊý¾ÝÀàÐÍ´íÎóµÄ»°£¨Exif µÄÕý³£ÐÐΪ£©¡£COMPUTED Ò²»á°üº¬ <emphasis>Copyright</emphasis>£¬ÒªÃ´ÊÇÔʼµÄ°æÈ¨×Ö·û´®£¬ÒªÃ´ÊǶººÅ·Ö¸ôµÄÉãÏñÓë±à¼µÄ°æÈ¨ÐÅÏ¢¡£ <!-- TNND£¬Äĸö»ìµ°Ð´µÃÕâô·Ñ½â£¿ When an Exif header contains a Copyright note this itself can contain two values. As the solution is inconsitent in the Exif 2.10 standard the COMPUTED section will return both entries <emphasis>Copyright.Photographer</emphasis> and <emphasis>Copyright.Editor</emphasis> 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 contain also an entry <emphasis>Copyright</emphasis> Which is either the original copyright string or it is a comma separated list of photo and editor copyright. --> </para> </note> <note> <para> UserComment ±ê¼ÇºÍ Copyright ÓÐͬÑùµÄÎÊÌâ¡£ËüÒ²¿ÉÒÔ´æ´¢Á½¸öÖµ£¬µÚÒ»¸öÊÇʹÓõıàÂ뷽ʽ£¬µÚ¶þ¸öÊÇÆäÖµ±¾Éí¡£Èç¹ûÕâÑùÔò IFD0 Çø¶Î½ö°üº¬±àÂ뷽ʽ»òÕßÒ»¸ö×Ö½ÚÊý×é¡£COMPUTED Çø¶Î½«´æ´¢Á½¸öÖµµ½ <emphasis>UserCommentEncoding</emphasis> ºÍ <emphasis>UserComment</emphasis>¡£<emphasis>UserComment</emphasis> ÔÚÁ½ÖÖÇé¿ö϶¼¿ÉÓÃÒò´ËÓ¦¸ÃÓÅÏÈʹÓÃËü¶ø²»ÊÇ IFD0 Çø¶ÎÖеĸÃÖµ¡£ </para> <para> Èç¹ûÓû§×¢ÊÍʹÓà Unicode »ò JIS ±àÂë²¢ÇÒ¿ÉÒÔʹÓà mbstring Ä£¿é£¬Ôò´Ë±àÂë»á¸ù¾Ý exif ÔÚ &php.ini; ÖеÄÉèÖÃ×Ô¶¯¸Ä±ä¡£ÕâÊÇ PHP 4.3 мӵġ£ </para> </note> <note> <para> Height ºÍ Width ÊÇÓÃºÍ <function>getimagesize</function> Ò»ÑùµÄ·½·¨¼ÆËãµÄ£¬Òò´ËËüÃǵÄÖµ²»ÄÜÊÇÈκηµ»ØµÄÍ·ÐÅÏ¢µÄ²¿·Ö¡£´ËÍâ html ÊÇÒ»¸ö height/width µÄÎı¾×Ö·û´®¿ÉÒÔÓÃÓÚÆÕͨµÄ <acronym>HTML</acronym> ÖС£ </para> </note> <note> <para> ×Ô PHP 4.3 Æð±¾º¯Êý¿ÉÒÔ¶ÁÈ¡ËùÓÐǶÈëµÄ <acronym>IFD</acronym> Êý¾Ý£¬°üÀ¨Êý×飨Ҳ·µ»ØÊý×飩¡£´ËÍâǶÈëµÄËõÂÔͼµÄ´óС°üÀ¨ÔÚ <emphasis>THUMBNAIL</emphasis> ×ÓÊý×éÖв¢ÇÒ <function>exif_read_data</function> ¿ÉÒÔ½«ËõÂÔͼ°´ÕÕ <acronym>TIFF</acronym> ¸ñʽ·µ»Ø¡£×îºó£¬²»ÔÙÓзµ»ØÖµ×î´ó³¤¶ÈµÄÏÞÖÆÁË£¨Ö±µ½´ïµ½ÄÚ´æÏÞ¶¨£©¡£ </para> </note> <note> <simpara> ±¾º¯Êý½öÔÚ PHP ±àÒëʱʹÓÃÁË <option role="configure">--enable-exif</option> Ñ¡Ïîʱ¿ÉÓá£Æä¹¦ÄܺÍÐÐΪÔÚ PHP 4.2 ¸Ä±äÁË£¬ÔçÆÚ°æ±¾¼«²»Îȶ¨¡£ </simpara> <simpara> ×Ô PHP 4.3 ÆðÓû§×¢ÊÍ¿ÉÒÔ×Ô¶¯Ð޸ıàÂ룬¼ÙÈç PHP 4 ±àÒëʱʹÓÃÁË <option role="configure">--enable-mbstring</option> µÄ»°¡£ </simpara> <simpara> ±¾º¯Êý²»ÐèÒª GD ͼÏñ¿â¡£ </simpara> <simpara> ²Î¼û <function>exif_thumbnail</function> ºÍ <function>getimagesize</function>¡£ </simpara> </note> </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-zh/reference/exif/functions/exif-thumbnail.xml?r=1.1&p=1 Index: phpdoc-zh/reference/exif/functions/exif-thumbnail.xml +++ phpdoc-zh/reference/exif/functions/exif-thumbnail.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: yincheng $ --> <!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.exif-thumbnail"> <refnamediv> <refname>exif_thumbnail</refname> <refpurpose>È¡µÃǶÈëÔÚ TIFF »ò JPEG ͼÏñÖеÄËõÂÔͼ</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>exif_thumbnail</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>&width</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>&height</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>&imagetype</parameter></methodparam> </methodsynopsis> <para> <function>exif_thumbnail</function> ¶ÁÈ¡ TIFF »ò JPEG ͼÏñÖеÄǶÈëËõÂÔͼ¡£Èç¹ûͼÏñ²»°üº¬ËõÂÔͼÔò·µ»Ø &false;¡£ </para> <para> ²ÎÊý <parameter>width</parameter>£¬<parameter>height</parameter> ºÍ <parameter>imagetype</parameter> ×Ô PHP 4.3.0 Æð¿ÉÓ㬷µ»ØËõÂÔͼµÄ´óСºÍÀàÐÍ¡£ÓпÉÄÜ <function>exif_thumbnail</function> ²»ÄÜ´´½¨Í¼Ïñµ«¿ÉÒԲⶨÆä´óС£¬´ËÇé¿öÏ·µ»ØÖµÊÇ &false;£¬µ«ÊÇ <parameter>width</parameter> ºÍ <parameter>height</parameter> µÄÖµÒѾ´«»ØÁË¡£ </para> <para> Èç¹ûÏëÓô˺¯Êý·¢ËÍËõÂÔͼ£¬Ó¦¸ÃÓà <function>header</function> º¯Êý·¢ËÍ mime ÀàÐÍÐÅÏ¢¡£ÏÂÃæµÄÀý×ÓÑÝʾÁË´Ë·½·¨£º </para> <para> <example> <title><function>exif_thumbnail</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php if (array_key_exists('file',$_REQUEST)) { $image = exif_thumbnail($_REQUEST['file'], $width, $height, $type); } else { $image = false; } if ($image!==false) { header("Content-type: ".image_type_to_mime_type($type)); echo $image; exit; } else { // no thumbnail available, handle the error here echo "No thumbnail available"; } ?> ]]> </programlisting> </example> </para> <para> ×Ô PHP 4.3.0 Æð£¬<function>exif_thumbnail</function> º¯Êý¿ÉÒÔÒÔ <acronym>TIFF</acronym> ¸ñʽ·µ»ØËõÂÔͼ¡£ </para> <note> <simpara> ±¾º¯Êý½öÔÚ PHP ±àÒëʱʹÓÃÁË <option role="configure">--enable-exif</option> Ñ¡Ïîʱ¿ÉÓá£Æä¹¦ÄܺÍÐÐΪÔÚ PHP 4.2 ¸Ä±äÁË¡£ </simpara> </note> <note> <simpara> ±¾º¯Êý²»ÐèÒª GD ͼÏñ¿â¡£ </simpara> </note> <simpara> ²Î¼û <function>exif_read_data</function> ºÍ <function>image_type_to_mime_type</function>¡£ </simpara> </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-zh/reference/exif/functions/read-exif-data.xml?r=1.1&p=1 Index: phpdoc-zh/reference/exif/functions/read-exif-data.xml +++ phpdoc-zh/reference/exif/functions/read-exif-data.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: yincheng $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.read-exif-data"> <refnamediv> <refname>read_exif_data</refname> <refpurpose><function>exif_read_data</function> µÄ±ðÃû</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <para> ±¾º¯ÊýÊÇ <function>exif_read_data</function> µÄ±ðÃû¡£ </para> </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:"../../../../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 -->
http://cvs.php.net/co.php/phpdoc-zh/reference/exif/functions/exif-imagetype.xml?r=1.1&p=1 Index: phpdoc-zh/reference/exif/functions/exif-imagetype.xml +++ phpdoc-zh/reference/exif/functions/exif-imagetype.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: yincheng $ --> <!-- EN-Revision: 1.13 Maintainer: dallas Status: ready --> <refentry id="function.exif-imagetype"> <refnamediv> <refname>exif_imagetype</refname> <refpurpose>ÅжÏÒ»¸öͼÏñµÄÀàÐÍ</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>int</type><methodname>exif_imagetype</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> </methodsynopsis> <para> <function>exif_imagetype</function> ¶Áȡһ¸öͼÏñµÄµÚÒ»¸ö×Ö½Ú²¢¼ì²éÆäÇ©Ãû¡£Èç¹û·¢ÏÖÁËÇ¡µ±µÄÇ©ÃûÔò·µ»ØÒ»¸ö³£Á¿£¬·ñÔò·µ»Ø &false;¡£·µ»ØÖµºÍ <function>getimagesize</function> ·µ»ØµÄÊý×éÖеÄË÷Òý 2 µÄÖµÊÇÒ»ÑùµÄ£¬µ«±¾º¯Êý¿ìµÃ¶à¡£ </para> <para> ¶¨ÒåÓÐÒÔϳ£Á¿£º <table> <title>ͼÏñÀàÐͳ£Á¿</title> <tgroup cols="2"> <thead> <row> <entry>Öµ</entry> <entry>³£Á¿</entry> </row> </thead> <tbody> <row> <entry>1</entry> <entry><constant>IMAGETYPE_GIF</constant></entry> </row> <row> <entry>2</entry> <entry><constant>IMAGETYPE_JPEG</constant></entry> </row> <row> <entry>3</entry> <entry><constant>IMAGETYPE_PNG</constant></entry> </row> <row> <entry>4</entry> <entry><constant>IMAGETYPE_SWF</constant></entry> </row> <row> <entry>5</entry> <entry><constant>IMAGETYPE_PSD</constant></entry> </row> <row> <entry>6</entry> <entry><constant>IMAGETYPE_BMP</constant></entry> </row> <row> <entry>7</entry> <entry><constant>IMAGETYPE_TIFF_II</constant> (intel byte order)</entry> </row> <row> <entry>8</entry> <entry> <constant>IMAGETYPE_TIFF_MM</constant> (motorola byte order) </entry> </row> <row> <entry>9</entry> <entry><constant>IMAGETYPE_JPC</constant></entry> </row> <row> <entry>10</entry> <entry><constant>IMAGETYPE_JP2</constant></entry> </row> <row> <entry>11</entry> <entry><constant>IMAGETYPE_JPX</constant></entry> </row> <row> <entry>12</entry> <entry><constant>IMAGETYPE_JB2</constant></entry> </row> <row> <entry>13</entry> <entry><constant>IMAGETYPE_SWC</constant></entry> </row> <row> <entry>14</entry> <entry><constant>IMAGETYPE_IFF</constant></entry> </row> <row> <entry>15</entry> <entry><constant>IMAGETYPE_WBMP</constant></entry> </row> <row> <entry>16</entry> <entry><constant>IMAGETYPE_XBM</constant></entry> </row> </tbody> </tgroup> </table> </para> <note> <para> ¶Ô <acronym>JPC</acronym>£¬<acronym>JP2</acronym>£¬<acronym>JPX</acronym>£¬<acronym>JB2</acronym>£¬<acronym>XBM</acronym> ºÍ <acronym>WBMP</acronym> µÄÖ§³Ö×Ô PHP 4.3.2 Æð¿ÉÓá£¶Ô <acronym>SWC</acronym> µÄÖ§³Ö×Ô PHP 4.3.0 Æð¿ÉÓᣠ</para> </note> <para> ±¾º¯Êý¿ÉÓÃÀ´±ÜÃâµ÷ÓÃÆäËü exif º¯ÊýÓõ½Á˲»Ö§³ÖµÄÎļþÀàÐÍÉÏ»òºÍ <varname>$_SERVER['HTTP_ACCEPT']</varname> ½áºÏʹÓÃÀ´¼ì²éä¯ÀÀÆ÷ÊÇ·ñ¿ÉÒÔÏÔʾij¸öÖ¸¶¨µÄͼÏñ¡£ </para> <note> <simpara> ±¾º¯Êý½öÔÚ PHP ±àÒëʱʹÓÃÁË <option role="configure">--enable-exif</option> Ñ¡Ïîʱ¿ÉÓᣠ</simpara> </note> <note> <simpara> ±¾º¯Êý²»ÐèÒª GD ͼÏñ¿â¡£ </simpara> </note> <example> <title><function>exif_imagetype</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php if (exif_imagetype("image.gif") != IMAGETYPE_GIF) { echo "The picture is not a gif"; } ?> ]]> </programlisting> </example> <simpara> ²Î¼û <function>getimagesize</function>¡£ </simpara> </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-zh/reference/exif/functions/exif-read-data.xml?r=1.1&p=1 Index: phpdoc-zh/reference/exif/functions/exif-read-data.xml +++ phpdoc-zh/reference/exif/functions/exif-read-data.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: yincheng $ --> <!-- EN-Revision: 1.15 Maintainer: dallas Status: ready --> <refentry id="function.exif-read-data"> <refnamediv> <refname>exif_read_data</refname> <refpurpose> ´Ó <acronym>JPEG</acronym> »ò <acronym>TIFF</acronym> ÎļþÖжÁÈ¡ <acronym>EXIF</acronym> Í·ÐÅÏ¢£¬ÕâÑù¾Í¿ÉÒÔ¶ÁÈ¡ÊýÂëÏà»ú²úÉúµÄÔªÊý¾Ý </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>array</type><methodname>exif_read_data</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>sections</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>arrays</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>thumbnail</parameter></methodparam> </methodsynopsis> <para> <function>exif_read_data</function> º¯Êý´Ó JPEG »ò TIFF ͼÏñÎļþÖжÁÈ¡ EXIF Í·ÐÅÏ¢¡£·µ»ØÒ»¸ö¹ØÁªÊý×飬¼üÃûÊÇÍ·ÐÅÏ¢Ãû£¬ÖµÎªÓëÆäÏàÓ¦µÄÖµ¡£Èç¹ûûÓпɹ©·µ»ØµÄÊý¾ÝÔò·µ»Ø &false;¡£ </para> <para> <parameter>filename</parameter> ÊDZ»¶ÁÈ¡µÄÎļþÃû¡£²»ÄÜÊÇ URL¡£ </para> <para> <parameter>sections</parameter> ÊÇÐèÒª´æÔÚÓÚÎļþÖеĶººÅ·Ö¸ôµÄÇø¶ÎÁбíÓÃÀ´²úÉú½á¹ûÊý×é¡£Èç¹ûδÕÒµ½ËùÇëÇóµÄÇø¶ÎÔò·µ»ØÖµÎª &false;¡£ <informaltable> <tgroup cols="2"> <tbody> <row> <entry>FILE</entry> <entry>FileName£¬FileSize£¬FileDateTime£¬SectionsFound</entry> </row> <row> <entry>COMPUTED</entry> <entry>html£¬Width£¬Height£¬IsColor£¬¿ÉÄÜÓиü¶àÆäËüµÄ¡£ </entry> </row> <row> <entry>ANY_TAG</entry> <entry>ÈκÎÓбê¼ÇµÄÐÅÏ¢£¬ÀýÈç IFD0£¬EXIF£¬...</entry> </row> <row> <entry>IFD0</entry> <entry> ËùÓÐ IFD0 µÄ±ê¼ÇÊý¾Ý¡£ÔÚ±ê×¼µÄͼÏñÎļþÖÐÕâ°üº¬ÁËͼÏñ´óС¼°ÆäËü¡£ </entry> </row> <row> <entry>THUMBNAIL</entry> <entry> Èç¹ûÓеڶþ¸ö IFD£¬ÎļþÓ¦¸Ã°üº¬ÓÐËõÂÔͼ¡£ËùÓÐÓйØÇ¶ÈëËõÂÔͼµÄ±ê¼ÇÐÅÏ¢¶¼´æ´¢ÔÚ±¾Çø¡£ </entry> </row> <row> <entry>COMMENT</entry> <entry>JPEG ͼÏñµÄ×¢ÊÍÍ·ÐÅÏ¢¡£</entry> </row> <row> <entry>EXIF</entry> <entry> EXIF Çø¶ÎÊÇ IFDO µÄ×ÓÇø£¬°üº¬ÓÐͼÏñµÄ¸ü¶àÏêϸÐÅÏ¢¡£´ó¶àÊýÄÚÈݶ¼ÊÇÊýÂëÏà»úÏà¹ØµÄ¡£ </entry> </row> </tbody> </tgroup> </informaltable> </para> <para> <parameter>arrays</parameter> Ö¸¶¨ÁËÊÇ·ñÿ¸öÇø¶Î¶¼³ÉΪһ¸öÊý×é¡£<emphasis>COMPUTED</emphasis> ºÍ <emphasis>THUMBNAIL</emphasis> Çø¶Î×ÜÊdzÉΪÊý×飬ÒòΪËüÃÇÀïÃæ°üº¬µÄÃû×ÖºÍÆäËüÇø¶Î³åÍ»¡£ </para> <para> <parameter>thumbnail</parameter> Ö¸¶¨ÁËÊÇ·ñ¶ÁÈ¡ËõÂÔͼ±¾Éí¶ø²»Ö»ÊDZê¼ÇÊý¾Ý¡£ </para> <note> <para> Exif Í·ÐÅÏ¢ÍùÍù´æÔÚÓÚÊýÂëÏà»úÉú³ÉµÄ JPEG/TIFF ͼÏñÖУ¬µ«²»ÐÒµÄÊÇÿ¸öÊýÂëÏà»úÖÆÔìÉ̵ıê¼Ç¶¼²»Í¬£¬Òò´Ë£¨±àд´úÂëʱ£©²»ÄÜÒÀÀµÓÚij¸öÌØ¶¨µÄ Exif Í·ÐÅÏ¢¡£ </para> <para> Windows ME/XP ÔÚÁ¬½Óµ½ÊýÂëÏà»úʱÄÜÇå³ýµô Exif Í·ÐÅÏ¢¡£¸ü¶àÐÅÏ¢¼û <ulink url="&url.winexif;">&url.winexif;</ulink>¡£ </para> </note> <para> <example> <title><function>exif_read_data</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php echo "test1.jpg:<br />\n"; $exif = exif_read_data ('tests/test1.jpg','IFD0'); echo $exif===false ? "No header data found.<br />\n" : "Image contains headers<br />"; $exif = exif_read_data ('tests/test2.jpg',0,true); echo "test2.jpg:<br />\n"; foreach($exif as $key=>$section) { foreach($section as $name=>$val) { echo "$key.$name: $val<br />\n"; } } ?> ]]> </programlisting> <para> µÚÒ»¸öµ÷ÓÃʧ°ÜÁË£¬ÒòΪͼÏñûÓÐÍ·ÐÅÏ¢¡£ <screen role="php"> <![CDATA[ test1.jpg: No header data found. test2.jpg: FILE.FileName: test2.jpg FILE.FileDateTime: 1017666176 FILE.FileSize: 1240 FILE.FileType: 2 FILE.SectionsFound: ANY_TAG, IFD0, THUMBNAIL, COMMENT COMPUTED.html: width="1" height="1" COMPUTED.Height: 1 COMPUTED.Width: 1 COMPUTED.IsColor: 1 COMPUTED.ByteOrderMotorola: 1 COMPUTED.UserComment: Exif test image. COMPUTED.UserCommentEncoding: ASCII COMPUTED.Copyright: Photo (c) M.Boerger, Edited by M.Boerger. COMPUTED.Copyright.Photographer: Photo (c) M.Boerger COMPUTED.Copyright.Editor: Edited by M.Boerger. IFD0.Copyright: Photo (c) M.Boerger IFD0.UserComment: ASCII THUMBNAIL.JPEGInterchangeFormat: 134 THUMBNAIL.JPEGInterchangeFormatLength: 523 COMMENT.0: Comment #1. COMMENT.1: Comment #2. COMMENT.2: Comment #3end THUMBNAIL.JPEGInterchangeFormat: 134 THUMBNAIL.Thumbnail.Height: 1 THUMBNAIL.Thumbnail.Height: 1 ]]> </screen> </para> </example> </para> <note> <para> Èç¹ûͼÏñ°üº¬ÈκΠIFD0 Êý¾Ý£¬Ôò COMPUTED »á°üº¬ÓÐÒ»Ïî ByteOrderMotorola£¬¶ÔÓÚ little-endian (intel) ×Ö½Ú˳Ðò£¬ÆäֵΪ 0£¬¶ÔÓÚ big-endian (motorola) ×Ö½Ú˳Ðò£¬ÆäֵΪ 1¡£ÕâÊÇ PHP 4.3 мӵġ£ </para> <para> µ±Ò»¸ö Exif Í·ÐÅÏ¢°üº¬ÓÐÒ»¸ö Copyright ʱעÒâËü±¾Éí¿ÉÒÔ°üº¬Á½¸öÖµ¡£½â¾ö·½°¸ºÍ Exif 2.10 ±ê×¼²»Ò»Ö£¬COMPUTED Çø¶Î»áͬʱ·µ»Ø <emphasis>Copyright.Photographer</emphasis> ºÍ <emphasis>Copyright.Editor</emphasis>£¬µ«ÊÇ IFD0 Çø¶ÎÔò°üº¬ÓÐÒ»¸ö×Ö½ÚÊý×éÓà NULL ×Ö·û·Ö¸ô¿ªÁ½¸öÏîÄ¿¡£»òÕßÖ»ÓеÚÒ»ÏîÈç¹ûÊý¾ÝÀàÐÍ´íÎóµÄ»°£¨Exif µÄÕý³£ÐÐΪ£©¡£COMPUTED Ò²»á°üº¬ <emphasis>Copyright</emphasis>£¬ÒªÃ´ÊÇÔʼµÄ°æÈ¨×Ö·û´®£¬ÒªÃ´ÊǶººÅ·Ö¸ôµÄÉãÏñÓë±à¼µÄ°æÈ¨ÐÅÏ¢¡£ <!-- TNND£¬Äĸö»ìµ°Ð´µÃÕâô·Ñ½â£¿ When an Exif header contains a Copyright note this itself can contain two values. As the solution is inconsitent in the Exif 2.10 standard the COMPUTED section will return both entries <emphasis>Copyright.Photographer</emphasis> and <emphasis>Copyright.Editor</emphasis> 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 contain also an entry <emphasis>Copyright</emphasis> Which is either the original copyright string or it is a comma separated list of photo and editor copyright. --> </para> </note> <note> <para> UserComment ±ê¼ÇºÍ Copyright ÓÐͬÑùµÄÎÊÌâ¡£ËüÒ²¿ÉÒÔ´æ´¢Á½¸öÖµ£¬µÚÒ»¸öÊÇʹÓõıàÂ뷽ʽ£¬µÚ¶þ¸öÊÇÆäÖµ±¾Éí¡£Èç¹ûÕâÑùÔò IFD0 Çø¶Î½ö°üº¬±àÂ뷽ʽ»òÕßÒ»¸ö×Ö½ÚÊý×é¡£COMPUTED Çø¶Î½«´æ´¢Á½¸öÖµµ½ <emphasis>UserCommentEncoding</emphasis> ºÍ <emphasis>UserComment</emphasis>¡£<emphasis>UserComment</emphasis> ÔÚÁ½ÖÖÇé¿ö϶¼¿ÉÓÃÒò´ËÓ¦¸ÃÓÅÏÈʹÓÃËü¶ø²»ÊÇ IFD0 Çø¶ÎÖеĸÃÖµ¡£ </para> <para> Èç¹ûÓû§×¢ÊÍʹÓà Unicode »ò JIS ±àÂë²¢ÇÒ¿ÉÒÔʹÓà mbstring Ä£¿é£¬Ôò´Ë±àÂë»á¸ù¾Ý exif ÔÚ &php.ini; ÖеÄÉèÖÃ×Ô¶¯¸Ä±ä¡£ÕâÊÇ PHP 4.3 мӵġ£ </para> </note> <note> <para> Height ºÍ Width ÊÇÓÃºÍ <function>getimagesize</function> Ò»ÑùµÄ·½·¨¼ÆËãµÄ£¬Òò´ËËüÃǵÄÖµ²»ÄÜÊÇÈκηµ»ØµÄÍ·ÐÅÏ¢µÄ²¿·Ö¡£´ËÍâ html ÊÇÒ»¸ö height/width µÄÎı¾×Ö·û´®¿ÉÒÔÓÃÓÚÆÕͨµÄ <acronym>HTML</acronym> ÖС£ </para> </note> <note> <para> ×Ô PHP 4.3 Æð±¾º¯Êý¿ÉÒÔ¶ÁÈ¡ËùÓÐǶÈëµÄ <acronym>IFD</acronym> Êý¾Ý£¬°üÀ¨Êý×飨Ҳ·µ»ØÊý×飩¡£´ËÍâǶÈëµÄËõÂÔͼµÄ´óС°üÀ¨ÔÚ <emphasis>THUMBNAIL</emphasis> ×ÓÊý×éÖв¢ÇÒ <function>exif_read_data</function> ¿ÉÒÔ½«ËõÂÔͼ°´ÕÕ <acronym>TIFF</acronym> ¸ñʽ·µ»Ø¡£×îºó£¬²»ÔÙÓзµ»ØÖµ×î´ó³¤¶ÈµÄÏÞÖÆÁË£¨Ö±µ½´ïµ½ÄÚ´æÏÞ¶¨£©¡£ </para> </note> <note> <simpara> ±¾º¯Êý½öÔÚ PHP ±àÒëʱʹÓÃÁË <option role="configure">--enable-exif</option> Ñ¡Ïîʱ¿ÉÓá£Æä¹¦ÄܺÍÐÐΪÔÚ PHP 4.2 ¸Ä±äÁË£¬ÔçÆÚ°æ±¾¼«²»Îȶ¨¡£ </simpara> <simpara> ×Ô PHP 4.3 ÆðÓû§×¢ÊÍ¿ÉÒÔ×Ô¶¯Ð޸ıàÂ룬¼ÙÈç PHP 4 ±àÒëʱʹÓÃÁË <option role="configure">--enable-mbstring</option> µÄ»°¡£ </simpara> <simpara> ±¾º¯Êý²»ÐèÒª GD ͼÏñ¿â¡£ </simpara> <simpara> ²Î¼û <function>exif_thumbnail</function> ºÍ <function>getimagesize</function>¡£ </simpara> </note> </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-zh/reference/exif/functions/exif-thumbnail.xml?r=1.1&p=1 Index: phpdoc-zh/reference/exif/functions/exif-thumbnail.xml +++ phpdoc-zh/reference/exif/functions/exif-thumbnail.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: yincheng $ --> <!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> <refentry id="function.exif-thumbnail"> <refnamediv> <refname>exif_thumbnail</refname> <refpurpose>È¡µÃǶÈëÔÚ TIFF »ò JPEG ͼÏñÖеÄËõÂÔͼ</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>exif_thumbnail</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>&width</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>&height</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>&imagetype</parameter></methodparam> </methodsynopsis> <para> <function>exif_thumbnail</function> ¶ÁÈ¡ TIFF »ò JPEG ͼÏñÖеÄǶÈëËõÂÔͼ¡£Èç¹ûͼÏñ²»°üº¬ËõÂÔͼÔò·µ»Ø &false;¡£ </para> <para> ²ÎÊý <parameter>width</parameter>£¬<parameter>height</parameter> ºÍ <parameter>imagetype</parameter> ×Ô PHP 4.3.0 Æð¿ÉÓ㬷µ»ØËõÂÔͼµÄ´óСºÍÀàÐÍ¡£ÓпÉÄÜ <function>exif_thumbnail</function> ²»ÄÜ´´½¨Í¼Ïñµ«¿ÉÒԲⶨÆä´óС£¬´ËÇé¿öÏ·µ»ØÖµÊÇ &false;£¬µ«ÊÇ <parameter>width</parameter> ºÍ <parameter>height</parameter> µÄÖµÒѾ´«»ØÁË¡£ </para> <para> Èç¹ûÏëÓô˺¯Êý·¢ËÍËõÂÔͼ£¬Ó¦¸ÃÓà <function>header</function> º¯Êý·¢ËÍ mime ÀàÐÍÐÅÏ¢¡£ÏÂÃæµÄÀý×ÓÑÝʾÁË´Ë·½·¨£º </para> <para> <example> <title><function>exif_thumbnail</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php if (array_key_exists('file',$_REQUEST)) { $image = exif_thumbnail($_REQUEST['file'], $width, $height, $type); } else { $image = false; } if ($image!==false) { header("Content-type: ".image_type_to_mime_type($type)); echo $image; exit; } else { // no thumbnail available, handle the error here echo "No thumbnail available"; } ?> ]]> </programlisting> </example> </para> <para> ×Ô PHP 4.3.0 Æð£¬<function>exif_thumbnail</function> º¯Êý¿ÉÒÔÒÔ <acronym>TIFF</acronym> ¸ñʽ·µ»ØËõÂÔͼ¡£ </para> <note> <simpara> ±¾º¯Êý½öÔÚ PHP ±àÒëʱʹÓÃÁË <option role="configure">--enable-exif</option> Ñ¡Ïîʱ¿ÉÓá£Æä¹¦ÄܺÍÐÐΪÔÚ PHP 4.2 ¸Ä±äÁË¡£ </simpara> </note> <note> <simpara> ±¾º¯Êý²»ÐèÒª GD ͼÏñ¿â¡£ </simpara> </note> <simpara> ²Î¼û <function>exif_read_data</function> ºÍ <function>image_type_to_mime_type</function>¡£ </simpara> </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-zh/reference/exif/functions/read-exif-data.xml?r=1.1&p=1 Index: phpdoc-zh/reference/exif/functions/read-exif-data.xml +++ phpdoc-zh/reference/exif/functions/read-exif-data.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: yincheng $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.read-exif-data"> <refnamediv> <refname>read_exif_data</refname> <refpurpose><function>exif_read_data</function> µÄ±ðÃû</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <para> ±¾º¯ÊýÊÇ <function>exif_read_data</function> µÄ±ðÃû¡£ </para> </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:"../../../../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 -->