mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
* Document WebP support
* Fix $Rev: $ for imageflip.xml git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@329888 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
03f632749c
commit
879bef7581
5 changed files with 193 additions and 4 deletions
|
@ -103,6 +103,12 @@
|
|||
<entry>&true;</entry>
|
||||
<entry>GD 1.8+</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>WebP</entry>
|
||||
<entry>&true;</entry>
|
||||
<entry>&true;</entry>
|
||||
<entry>GD 2.1+, PHP 5.5+</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
|
88
reference/image/functions/imagecreatefromwebp.xml
Normal file
88
reference/image/functions/imagecreatefromwebp.xml
Normal file
|
@ -0,0 +1,88 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Rev$ -->
|
||||
<refentry xml:id="function.imagecreatefromwebp" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>imagecreatefromwebp</refname>
|
||||
<refpurpose>&gd.image.new;</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>resource</type><methodname>imagecreatefromwebp</methodname>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>imagecreatefromwebp</function> returns an image identifier
|
||||
representing the image obtained from the given filename.
|
||||
</para>
|
||||
&tip.fopen-wrapper;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>filename</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Path to the WebP image.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>&gd.return.identifier;</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Convert an WebP image to a jpeg image using <function>imagecreatefromwebp</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Load the WebP file
|
||||
$im = imagecreatefromxbm('./example.webp');
|
||||
|
||||
// Convert it to a jpeg file with 100% quality
|
||||
imagejpeg($im, './example.jpeg', 100);
|
||||
imagedestroy($im);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
</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
|
||||
-->
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $ -->
|
||||
<!-- $Rev$ -->
|
||||
<refentry xml:id="function.imageflip" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>imageflip</refname>
|
||||
|
|
93
reference/image/functions/imagewebp.xml
Normal file
93
reference/image/functions/imagewebp.xml
Normal file
|
@ -0,0 +1,93 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Rev$ -->
|
||||
<refentry xml:id="function.imagewebp" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>imagewebp</refname>
|
||||
<refpurpose>Output an WebP image to browser or file</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>imagewebp</methodname>
|
||||
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Outputs or save an WebP version of the given <parameter>image</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&gd.image.description;
|
||||
<varlistentry>
|
||||
<term><parameter>filename</parameter></term>
|
||||
<listitem>
|
||||
<para>&gd.image.path;</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Saving an WebP file</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Create a blank image and add some text
|
||||
$im = imagecreatetruecolor(120, 20);
|
||||
$text_color = imagecolorallocate($im, 233, 14, 91);
|
||||
|
||||
imagestring($im, 1, 5, 5, 'WebP with PHP', $text_color);
|
||||
|
||||
// Save the image
|
||||
imagewebp($im, 'php.webp');
|
||||
|
||||
// Free up memory
|
||||
imagedestroy($im);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
</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
|
||||
-->
|
|
@ -48,9 +48,10 @@
|
|||
<function name='imagecreatefromwbmp' from='PHP 4 >= 4.0.1, PHP 5'/>
|
||||
<function name='imagecreatefromxbm' from='PHP 4 >= 4.0.1, PHP 5'/>
|
||||
<function name='imagecreatefromxpm' from='PHP 4 >= 4.0.1, PHP 5'/>
|
||||
<function name='imagecreatefromwebp' from='PHP 5 >= 5.5.0'/>
|
||||
<function name='imagecreatetruecolor' from='PHP 4 >= 4.0.6, PHP 5'/>
|
||||
<function name='imagecrop' from='PHP >= 5.5.0'/>
|
||||
<function name='imagecropauto' from='PHP >= 5.5.0'/>
|
||||
<function name='imagecrop' from='PHP 5 >= 5.5.0'/>
|
||||
<function name='imagecropauto' from='PHP 5 >= 5.5.0'/>
|
||||
<function name='imagedashedline' from='PHP 4, PHP 5'/>
|
||||
<function name='imagedestroy' from='PHP 4, PHP 5'/>
|
||||
<function name='imageellipse' from='PHP 4 >= 4.0.6, PHP 5'/>
|
||||
|
@ -61,7 +62,7 @@
|
|||
<function name='imagefilledrectangle' from='PHP 4, PHP 5'/>
|
||||
<function name='imagefilltoborder' from='PHP 4, PHP 5'/>
|
||||
<function name='imagefilter' from='PHP 5'/>
|
||||
<function name='imageflip' from='PHP >= 5.5.0'/>
|
||||
<function name='imageflip' from='PHP 5 >= 5.5.0'/>
|
||||
<function name='imagefontheight' from='PHP 4, PHP 5'/>
|
||||
<function name='imagefontwidth' from='PHP 4, PHP 5'/>
|
||||
<function name='imageftbbox' from='PHP 4 >= 4.0.7, PHP 5'/>
|
||||
|
@ -107,6 +108,7 @@
|
|||
<function name='imagetypes' from='PHP 4 >= 4.0.2, PHP 5'/>
|
||||
<function name='imagewbmp' from='PHP 4 >= 4.0.1, PHP 5'/>
|
||||
<function name='imagexbm' from='PHP 5'/>
|
||||
<function name='imagewebp' from='PHP 5 >= 5.5.0'/>
|
||||
<function name='iptcembed' from='PHP 4, PHP 5'/>
|
||||
<function name='iptcparse' from='PHP 4, PHP 5'/>
|
||||
<function name='jpeg2wbmp' from='PHP 4 >= 4.0.5, PHP 5'/>
|
||||
|
|
Loading…
Reference in a new issue