Add missing gd docs

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@21451 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Rasmus Lerdorf 2000-03-13 06:15:35 +00:00
parent 6489b73342
commit 44d1ba627a

View file

@ -463,6 +463,81 @@ function LoadGif($imgname)
</refsect1>
</refentry>
<refentry id="function.imagecreatefromjpg">
<refnamediv>
<refname>ImageCreateFromJpeg</refname>
<refpurpose>create a new image from file or URL</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imagecreatefromjpeg</function></funcdef>
<paramdef>string <parameter>filename</parameter></paramdef>
</funcsynopsis>
<para>
<function>imagecreatefromjpeg</function> returns an image identifier
representing the image obtained from the given filename.</para>
<para>
<function>imagecreatefromjpeg</function> returns an empty string
on failure. It also outputs an error message, which unfortunately
displays as a broken link in a browser. To ease debugging the
following example will produce an error JPEG:
<example>
<title>Example to handle an error during creation (courtesy vic@zymsys.com )</title>
<programlisting role="php">
function LoadJpeg($imgname)
{
$im = @imagecreatefromjpeg($imgname); /* Attempt to open */
if ($im == "") { /* See if it failed */
$im = ImageCreate(150,30); /* Create a blank image */
$bgc = ImageColorAllocate($im,255,255,255);
$tc = ImageColorAllocate($im,0,0,0);
ImageFilledRectangle($im,0,0,150,30,$bgc);
ImageString($im,1,5,5,"Error loading $imgname",$tc); /* Output an errmsg */
}
return $im;
}
</programlisting></example>
</para>
</refsect1>
<refentry id="function.imagecreatefrompng">
<refnamediv>
<refname>ImageCreateFromPNG</refname>
<refpurpose>create a new image from file or URL</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imagecreatefrompng</function></funcdef>
<paramdef>string <parameter>filename</parameter></paramdef>
</funcsynopsis>
<para>
<function>imagecreatefrompng</function> returns an image identifier
representing the image obtained from the given filename.</para>
<para>
<function>imagecreatefrompng</function> returns an empty string
on failure. It also outputs an error message, which unfortunately
displays as a broken link in a browser. To ease debugging the
following example will produce an error PNG:
<example>
<title>Example to handle an error during creation (courtesy vic@zymsys.com )</title>
<programlisting role="php">
function LoadPNG($imgname)
{
$im = @imagecreatefrompng($imgname); /* Attempt to open */
if ($im == "") { /* See if it failed */
$im = ImageCreate(150,30); /* Create a blank image */
$bgc = ImageColorAllocate($im,255,255,255);
$tc = ImageColorAllocate($im,0,0,0);
ImageFilledRectangle($im,0,0,150,30,$bgc);
ImageString($im,1,5,5,"Error loading $imgname",$tc); /* Output an errmsg */
}
return $im;
}
</programlisting></example>
</para>
<refentry id="function.imagedashedline">
<refnamediv>
<refname>ImageDashedLine</refname>
@ -641,7 +716,7 @@ function LoadGif($imgname)
<funcsynopsis>
<funcdef>int <function>imagegif</function></funcdef>
<paramdef>int <parameter>im</parameter></paramdef>
<paramdef>string <parameter>filename</parameter></paramdef>
<paramdef>string <parameter><optional>filename</optional></parameter></paramdef>
</funcsynopsis>
<para>
<function>imagegif</function> creates the GIF file in filename
@ -667,6 +742,39 @@ function LoadGif($imgname)
</refsect1>
</refentry>
<refentry id="function.imagejpeg">
<refnamediv>
<refname>ImageJpeg</refname>
<refpurpose>output image to browser or file</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>imagejpeg</function></funcdef>
<paramdef>int <parameter>im</parameter></paramdef>
<paramdef>string <parameter><optional>filename</optional></parameter></paramdef>
<paramdef>int <parameter><optional>quality</optional></parameter></paramdef>
</funcsynopsis>
<para>
<function>imagejpeg</function> creates the JPEG file in filename
from the image <parameter>im</parameter>. The
<parameter>im</parameter> argument is the return from the
<function>imagecreate</function> function.</para>
<para>
The filename argument is optional, and if left off, the raw image
stream will be output directly. To skip the filename argument in order
to provide a quality argument just use an empty string (''). By sending
an image/jpg content-type using <function>header</function>, you can create a
PHP script that outputs JPEG images directly.
<note>
<para>
JPEG support is only available in PHP if PHP was compiled against GD-1.8
or later.</para>
</note></para>
</refsect1>
</refentry>
<refentry id="function.imageinterlace">
<refnamediv>
<refname>ImageInterlace</refname>