goba Sun Nov 11 08:40:28 2001 EDT Modified files: /phpdoc/en/functions image.xml Log: Adding a bunch of undocumented functions: image2wbmp jpeg2wbmp png2wbmp imagepalettecopy imagecreatefromxpm imagecreatefromxbm Adding some more info about the new foreground argument to imagewbmp, and adding PSD and BMP information to getimagesize.
Index: phpdoc/en/functions/image.xml diff -u phpdoc/en/functions/image.xml:1.60 phpdoc/en/functions/image.xml:1.61 --- phpdoc/en/functions/image.xml:1.60 Sat Nov 10 16:49:36 2001 +++ phpdoc/en/functions/image.xml Sun Nov 11 08:40:28 2001 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.60 $ --> +<!-- $Revision: 1.61 $ --> <reference id="ref.image"> <title>Image functions</title> <titleabbrev>Image</titleabbrev> @@ -37,7 +37,7 @@ <refentry id="function.getimagesize"> <refnamediv> <refname>GetImageSize</refname> - <refpurpose>Get the size of a GIF, JPEG, PNG or SWF image</refpurpose> + <refpurpose>Get the size of an image</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -53,16 +53,17 @@ <para> The <function>GetImageSize</function> function will determine the size of any <acronym>GIF</acronym>, <acronym>JPG</acronym>, - <acronym>PNG</acronym> or <acronym>SWF</acronym> image file and + <acronym>PNG</acronym>, <acronym>SWF</acronym>, + <acronym>PSD</acronym> or <acronym>BMP</acronym> image file and return the dimensions along with the file type and a height/width text string to be used inside a normal <acronym>HTML</acronym> <sgmltag>IMG</sgmltag> tag. </para> <para> - Returns an array with 4 elements. Index 0 contains the width of - the image in pixels. Index 1 contains the height. Index 2 a + Returns an array with 4 elements. Index 0 contains the width of + the image in pixels. Index 1 contains the height. Index 2 a flag indicating the type of the image. 1 = GIF, 2 = JPG, 3 = - PNG, 4 = SWF. Index 3 is a text string with the correct + PNG, 4 = SWF, 5 = PSD, 6 = BMP. Index 3 is a text string with the correct "height=xxx width=xxx" string that can be used directly in an IMG tag. <example> @@ -82,7 +83,7 @@ </example> </para> <para> - With <acronym>JPEG</acronym> images, two extras index are returned : + With <acronym>JPG</acronym> images, two extras index are returned : <literal>channel</literal> and <literal>bits</literal>. <literal>channel</literal> will be 3 for RGB pictures, and 4 for CMYK pictures. <literal>bits</literal> is the number of bits for each color. @@ -129,6 +130,50 @@ </refsect1> </refentry> + <refentry id="function.image2wbmp"> + <refnamediv> + <refname>Image2WBMP</refname> + <refpurpose>Output image to browser or file</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>image2WBMP</function></funcdef> + <paramdef>int <parameter>im</parameter></paramdef> + <paramdef>string + <parameter><optional>filename</optional></parameter> + </paramdef> + <paramdef>int + <parameter><optional>threshold</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>Image2WBMP</function> creates the + <acronym>WBMP</acronym> 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. + By sending an <acronym>image/vnd.wap.wbmp</acronym> content-type + using <function>header</function>, you can create + a PHP script that outputs WBMP images directly. + <note> + <para> + WBMP support is only available in PHP if PHP was compiled + against GD-1.8 or later. + </para> + </note> + </para> + <para> + See also <function>ImageWBMP</function>. + </para> + </refsect1> + </refentry> + <refentry id="function.imagealphablending"> <refnamediv> <refname>ImageAlphaBlending</refname> @@ -1324,6 +1369,12 @@ } </programlisting> </example> + <note> + <para> + WBMP support is only available in PHP if PHP was compiled + against GD-1.8 or later. + </para> + </note> </para> </refsect1> </refentry> @@ -1348,6 +1399,46 @@ </refsect1> </refentry> + <refentry id="function.imagecreatefromxbm"> + <refnamediv> + <refname>ImageCreateFromXBM</refname> + <refpurpose>Create a new image from file or URL</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>imagecreatefromxbm</function></funcdef> + <paramdef>string <parameter>filename</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>ImageCreateFromXBM</function> returns an image identifier + representing the image obtained from the given filename. + </para> + </refsect1> + </refentry> + + <refentry id="function.imagecreatefromxpm"> + <refnamediv> + <refname>ImageCreateFromXPM</refname> + <refpurpose>Create a new image from file or URL</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>imagecreatefromxpm</function></funcdef> + <paramdef>string <parameter>filename</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>ImageCreateFromXPM</function> returns an image identifier + representing the image obtained from the given filename. + </para> + </refsect1> + </refentry> + <refentry id="function.imagedashedline"> <refnamediv> <refname>ImageDashedLine</refname> @@ -1759,6 +1850,9 @@ <paramdef>string <parameter><optional>filename</optional></parameter> </paramdef> + <paramdef>int + <parameter><optional>foreground</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> @@ -1781,8 +1875,15 @@ </note> </para> <para> - See also <function>ImagePNG</function>, <function>ImageGIF</function>, - <function>ImageJPEG</function>, <function>ImageTypes</function>. + Using the optional <parameter>foreground</parameter> + parameter, you can set the foreground color. Use an + identifier obtained from <function>imagecolorallocate</function>. + The default foreground color is black. + </para> + <para> + See also <function>image2WBMP</function>, <function>ImagePNG</function>, + <function>ImageGIF</function>, <function>ImageJPEG</function>, + <function>ImageTypes</function>. </para> </refsect1> </refentry> @@ -1926,6 +2027,28 @@ </refsect1> </refentry> + <refentry id="function.imagepalettecopy"> + <refnamediv> + <refname>ImagePaletteCopy</refname> + <refpurpose>Copy the palette from one image to another</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>imagepalettecopy</function></funcdef> + <paramdef>resource <parameter>destination</parameter></paramdef> + <paramdef>resource <parameter>source</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>imagepalettecopy</function> copies the + palette from the <parameter>source</parameter> image + to the <parameter>destination</parameter> image. + </para> + </refsect1> + </refentry> + <refentry id="function.imagepolygon"> <refnamediv> <refname>ImagePolygon</refname> @@ -2923,6 +3046,84 @@ ?> </programlisting> </example> + </para> + </refsect1> + </refentry> + + <refentry id="function.jpeg2wbmp"> + <refnamediv> + <refname>JPEG2WBMP</refname> + <refpurpose> + Convert JPEG image file to WBMP image file + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>jpeg2wbmp</function></funcdef> + <paramdef>string <parameter>jpegname</parameter></paramdef> + <paramdef>string <parameter>wbmpname</parameter></paramdef> + <paramdef>int <parameter>d_height</parameter></paramdef> + <paramdef>int <parameter>d_width</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Converts the <parameter>jpegname</parameter> JPEG file + to WBMP format, and saves it as <parameter>wbmpname</parameter>. + With the <parameter>d_height</parameter> and + <parameter>d_width</parameter> you specify the height + and width of the destination image. + </para> + <para> + <note> + <para> + WBMP support is only available in PHP if PHP was compiled + against GD-1.8 or later. + </para> + </note> + </para> + <para> + See also <function>png2wbmp</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.png2wbmp"> + <refnamediv> + <refname>PNG2WBMP</refname> + <refpurpose> + Convert PNG image file to WBMP image file + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>png2wbmp</function></funcdef> + <paramdef>string <parameter>pngname</parameter></paramdef> + <paramdef>string <parameter>wbmpname</parameter></paramdef> + <paramdef>int <parameter>d_height</parameter></paramdef> + <paramdef>int <parameter>d_width</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Converts the <parameter>pngname</parameter> PNG file + to WBMP format, and saves it as <parameter>wbmpname</parameter>. + With the <parameter>d_height</parameter> and + <parameter>d_width</parameter> you specify the height + and width of the destination image. + </para> + <para> + <note> + <para> + WBMP support is only available in PHP if PHP was compiled + against GD-1.8 or later. + </para> + </note> + </para> + <para> + See also <function>jpeg2wbmp</function>. </para> </refsect1> </refentry>