com doc/zh: 更新 imageinterlace() 和 gd_info() 翻译 Close php/ doc-zh#11: reference/image/functions/gd-info.xml reference/image/functions/imageinterlace.xml

[email protected] (Dai Jie) Fri, 29 Jan 2021 06:51:55 +0000
Newsgroups php.doc.zh
Message-ID <[email protected]>
Commit:    2590ef8415400ad06c3c7c6d81e6fc7562b30333
Author:    jwj <[email protected]>         Thu, 28 Jan 2021 12:39:58 +0800
Committer: daijie <[email protected]>      Fri, 29 Jan 2021 14:51:55 +0800
Parents:   a1844e74347c844f48c66b6eb63fa28efdf7863c
Branches:  master

Link:       http://git.php.net/?p=doc/zh.git;a=commitdiff;h=2590ef8415400ad06c3c7c6d81e6fc7562b30333

Log:
更新 imageinterlace() 和 gd_info() 翻译
Close php/doc-zh#11

Bugs:
https://bugs.php.net/11

Changed paths:
  M  reference/image/functions/gd-info.xml
  M  reference/image/functions/imageinterlace.xml
diff_2590ef8415400ad06c3c7c6d81e6fc7562b30333.txt (text/plain, 11.6 KB)
diff --git a/reference/image/functions/gd-info.xml b/reference/image/functions/gd-info.xml
index 455e65fa..711ca61c 100644
--- a/reference/image/functions/gd-info.xml
+++ b/reference/image/functions/gd-info.xml
@@ -1,113 +1,134 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
 <!-- $Author$ -->
-<!-- EN-Revision: n/a Maintainer: dallas Status: ready -->
-  <refentry xml:id='function.gd-info' xmlns="http://docbook.org/ns/docbook">
-   <refnamediv>
-    <refname>gd_info</refname>
-    <refpurpose>取得当前安装的 GD 库的信息</refpurpose>
-   </refnamediv>
-   <refsect1>
-    <title>说明</title>
-    <methodsynopsis>
-     <type>array</type><methodname>gd_info</methodname>
-     <void/>
-    </methodsynopsis>
-    <simpara>
-     返回一个关联数组描述了安装的 GD 库的版本和性能。
-    </simpara>
-    <para>
-     <table>
-      <title><function>gd_info</function> 返回的数组的单元</title>
-      <tgroup cols="2">
-       <thead>
-        <row>
-         <entry>属性</entry>
-         <entry>含义</entry>
-        </row>
-       </thead>
-       <tbody>
-        <row>
-         <entry>GD Version</entry>
-         <entry><type>string</type> 值描述了安装的 <literal>libgd</literal> 的版本。</entry>
-        </row>
-        <row>
-         <entry>Freetype Support</entry>
-         <entry><type>boolean</type> 值。如果安装了 Freetype 支持则为 &true;。</entry>
-        </row>
-        <row>
-         <entry>Freetype Linkage</entry>
-         <entry>
-          <type>string</type> 值描述了 Freetype 连接的方法。取值可能为:'with freetype',
-          'with TTF library' 和 'with unknown library'。本单元仅在
-          <literal>Freetype Support</literal> 的值为 &true; 时有定义。
-         </entry>
-        </row>
-        <row>
-         <entry>T1Lib Support</entry>
-         <entry><type>boolean</type> 值。如果包含有 <literal>T1Lib</literal> 支持则为 &true;。</entry>
-        </row>
-        <row>
-         <entry>GIF Read Support</entry>
-         <entry>
-          <type>boolean</type> 值。如果包含有<emphasis>读取</emphasis>
-          <literal>GIF</literal> 图像的支持则为 &true;。
-         </entry>
-        </row>
-        <row>
-         <entry>GIF Create Support</entry>
-         <entry>
-          <type>boolean</type> 值。如果包含有<emphasis>创建</emphasis>
-          <literal>GIF</literal> 图像的支持则为 &true;。
-         </entry>
-        </row>
-        <row>
-         <entry>JPG Support</entry>
-         <entry><type>boolean</type> 值。如果包含有 <literal>JPG</literal> 支持则为 &true;。</entry>
-        </row>
-        <row>
-         <entry>PNG Support</entry>
-         <entry><type>boolean</type> 值。如果包含有 <literal>PNG</literal> 支持则为 &true;。</entry>
-        </row>
-        <row>
-         <entry>WBMP Support</entry>
-         <entry><type>boolean</type> 值。如果包含有 <literal>WBMP</literal> 支持则为 &true;。</entry>
-        </row>
-        <row>
-         <entry>XBM Support</entry>
-         <entry><type>boolean</type> 值。如果包含有 <literal>XBM</literal> 支持则为 &true;。</entry>
-        </row>
-       </tbody>
-      </tgroup>
-     </table>
-    </para>
-    <para>
-     <example>
-      <title>使用 <function>gd_info</function></title>
-      <programlisting role="php">
+<!-- EN-Revision: 86e6094e86b84a51d00ab217ac50ce8dde33d82a Maintainer: dallas Status: ready -->
+<refentry xml:id='function.gd-info' xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+  <refname>gd_info</refname>
+  <refpurpose>取得当前安装的 GD 库的信息</refpurpose>
+ </refnamediv>
+ <refsect1 role="description">
+  &reftitle.description;
+  <methodsynopsis>
+   <type>array</type><methodname>gd_info</methodname>
+   <void/>
+  </methodsynopsis>
+  <para>
+   获取当前安装的 GD 库的版本和功能的信息。
+  </para>
+ </refsect1>
+ <refsect1 role="returnvalues">
+  &reftitle.returnvalues;
+  <para>
+   返回一个关联数组。
+  </para>
+  <para>
+   <table>
+    <title><function>gd_info</function> 返回的数组元素</title>
+    <tgroup cols="2">
+     <thead>
+      <row>
+       <entry>属性</entry>
+       <entry>含义</entry>
+      </row>
+     </thead>
+     <tbody>
+      <row>
+       <entry>GD Version</entry>
+       <entry>描述安装的 <literal>libgd</literal> 的版本的 <type>string</type> 值。</entry>
+      </row>
+      <row>
+       <entry>FreeType Support</entry>
+       <entry><type>bool</type> 值。如果安装了 FreeType 支持则为 &true;。</entry>
+      </row>
+      <row>
+       <entry>FreeType Linkage</entry>
+       <entry>
+        描述 FreeType 链接方式的 <type>string</type> 值。
+        可能值为:'with freetype'、'with TTF library' 和 'with unknown library'。
+        仅当 <literal>FreeType Support</literal> 为 &true; 时才会有该属性。
+       </entry>
+      </row>
+      <row>
+       <entry>GIF Read Support</entry>
+       <entry>
+        <type>bool</type> 值。
+        如果支持 <emphasis>读取</emphasis> <literal>GIF</literal> 图像, 则为 &true;。
+       </entry>
+      </row>
+      <row>
+       <entry>GIF Create Support</entry>
+       <entry>
+        <type>bool</type> 值。
+        如果支持 <emphasis>创建</emphasis> <literal>GIF</literal> 图像, 则为 &true;。
+       </entry>
+      </row>
+      <row>
+       <entry>JPEG Support</entry>
+       <entry>
+        <type>bool</type> 值。
+        如果支持 <literal>JPEG</literal> 则为 &true; 。
+       </entry>
+      </row>
+      <row>
+       <entry>PNG Support</entry>
+       <entry>
+        <type>bool</type> 值。
+        如果支持 <literal>PNG</literal> 则为 &true; 。
+       </entry>
+      </row>
+      <row>
+       <entry>WBMP Support</entry>
+       <entry>
+        <type>bool</type> 值。
+        如果支持 <literal>WBMP</literal> 则为 &true; 。
+       </entry>
+      </row>
+      <row>
+       <entry>XBM Support</entry>
+       <entry>
+        <type>bool</type> 值。
+        如果支持 <literal>XBM</literal> 则为 &true; 。
+       </entry>
+      </row>
+      <row>
+       <entry>WebP Support</entry>
+       <entry>
+        <type>bool</type> 值。
+        如果支持 <literal>WebP</literal> 则为 &true; 。
+       </entry>
+      </row>
+     </tbody>
+    </tgroup>
+   </table>
+  </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+  &reftitle.examples;
+  <para>
+   <example>
+    <title>使用 <function>gd_info</function></title>
+    <programlisting role="php">
 <![CDATA[
 <?php
 var_dump(gd_info());
 ?>
 ]]>
-      </programlisting>
-      <para>
-       典型输出为:
-      </para>
-      <screen>
+    </programlisting>
+    &example.outputs.similar;
+    <screen>
 <![CDATA[
-array(9) {
+array(10) {
   ["GD Version"]=>
-  string(24) "bundled (2.0 compatible)"
+  string(24) "bundled (2.1.0 compatible)"
   ["FreeType Support"]=>
   bool(false)
-  ["T1Lib Support"]=>
-  bool(false)
   ["GIF Read Support"]=>
   bool(true)
   ["GIF Create Support"]=>
   bool(false)
-  ["JPG Support"]=>
+  ["JPEG Support"]=>
   bool(false)
   ["PNG Support"]=>
   bool(true)
@@ -115,17 +136,27 @@ array(9) {
   bool(true)
   ["XBM Support"]=>
   bool(false)
+  ["WebP Support"]=>
+  bool(false)
 }
 ]]>
-      </screen>
-     </example>
-    </para>
-    <simpara>
-     参见 <function>imagepng</function>,<function>imagejpeg</function>,<function>imagegif</function>,<function>imagewbmp</function>
-     和 <function>imagetypes</function>。
-    </simpara>
-   </refsect1>
-  </refentry>
+    </screen>
+   </example>
+  </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+  &reftitle.seealso;
+  <simplelist>
+   <member><function>imagepng</function></member>
+   <member><function>imagejpeg</function></member>
+   <member><function>imagegif</function></member>
+   <member><function>imagewbmp</function></member>
+   <member><function>imagewebp</function></member>
+   <member><function>imagetypes</function></member>
+  </simplelist>
+ </refsect1>
+</refentry>
 
 <!-- Keep this comment at the end of the file
 Local variables:
diff --git a/reference/image/functions/imageinterlace.xml b/reference/image/functions/imageinterlace.xml
index 5909c5e2..3b358d22 100644
--- a/reference/image/functions/imageinterlace.xml
+++ b/reference/image/functions/imageinterlace.xml
@@ -1,32 +1,72 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
 <!-- $Author$ -->
-<!-- EN-Revision: n/a Maintainer: dallas Status: ready -->
-  <refentry xml:id="function.imageinterlace" xmlns="http://docbook.org/ns/docbook">
-   <refnamediv>
-    <refname>imageinterlace</refname>
-    <refpurpose>激活或禁止隔行扫描</refpurpose>
-   </refnamediv>
-   <refsect1>
-    <title>说明</title>
-    <methodsynopsis>
-     <type>int</type><methodname>imageinterlace</methodname>
-     <methodparam><type>resource</type><parameter>image</parameter></methodparam>
-     <methodparam choice="opt"><type>int</type><parameter>interlace</parameter></methodparam>
-    </methodsynopsis>
-    <para>
-     <function>imageinterlace</function> 打开或关闭隔行扫描的比特标记。如果
-     <parameter>interlace</parameter> 为 1 则图像为隔行扫描的,如果
-     <parameter>interlace</parameter> 为 0 则图像为非隔行扫描的。
-    </para>
-    <para>
-     如果设定了隔行扫描比特标记而图像使用 JPEG 格式,则图像被创建为渐进式 JPEG。
-    </para>
-    <para>
-     本函数返回图像中是否设定了隔行扫描比特标记。
-    </para>
-   </refsect1>
-  </refentry>
+<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: dallas Status: ready -->
+<refentry xml:id="function.imageinterlace" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+  <refname>imageinterlace</refname>
+  <refpurpose>启用或禁用隔行扫描</refpurpose>
+ </refnamediv>
+ <refsect1 role="description">
+  &reftitle.description;
+  <methodsynopsis>
+   <type>int</type><methodname>imageinterlace</methodname>
+   <methodparam><type>resource</type><parameter>image</parameter></methodparam>
+   <methodparam choice="opt"><type>int</type><parameter>interlace</parameter><initializer>0</initializer></methodparam>
+  </methodsynopsis>
+  <para>
+   <function>imageinterlace</function> 打开或关闭隔行扫描位(bit)。
+  </para>
+  <para>
+   如果设置了隔行扫描位(interlace bit),对于 <acronym>JPEG</acronym> 图像,会被创建为渐进式 <acronym>JPEG</acronym> 图像。
+  </para>
+ </refsect1>
+ <refsect1 role="parameters">
+  &reftitle.parameters;
+  <para>
+   <variablelist>
+    &gd.image.description;
+    <varlistentry>
+     <term><parameter>interlace</parameter></term>
+     <listitem>
+      <para>
+       如果为 0 ,则关闭隔行扫描,否则将打开隔行扫描。
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </para>
+ </refsect1>
+ <refsect1 role="returnvalues">
+  &reftitle.returnvalues;
+  <para>
+   如果为图像设置了隔行扫描,则返回 1 ,否则返回 0 。
+  </para>
+ </refsect1>
+ <refsect1 role="examples">
+  &reftitle.examples;
+  <para>
+   <example>
+    <title>使用 <function>imageinterlace</function> 打开隔行扫描</title>
+    <programlisting role="php">
+<![CDATA[
+<?php
+// 创建一个图像实例
+$im = imagecreatefromgif('php.gif');
+
+// 打开隔行扫描
+imageinterlace($im, true);
+
+// 保存图像
+imagegif($im, './php_interlaced.gif');
+imagedestroy($im);
+?>
+]]>
+    </programlisting>
+   </example>
+  </para>
+ </refsect1>
+</refentry>
 
 <!-- Keep this comment at the end of the file
 Local variables: