From d7fb97e019681fc8ae3c946297d471c89f4f3be7 Mon Sep 17 00:00:00 2001 From: Gabor Hojtsy Date: Sun, 11 Nov 2001 13:40:28 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@61986 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/image.xml | 219 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 210 insertions(+), 9 deletions(-) diff --git a/functions/image.xml b/functions/image.xml index 899b32226a..e9b61e3c13 100644 --- a/functions/image.xml +++ b/functions/image.xml @@ -1,5 +1,5 @@ - + Image functions Image @@ -37,7 +37,7 @@ GetImageSize - Get the size of a GIF, JPEG, PNG or SWF image + Get the size of an image Description @@ -53,16 +53,17 @@ The GetImageSize function will determine the size of any GIF, JPG, - PNG or SWF image file and + PNG, SWF, + PSD or BMP image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag. - 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. @@ -82,7 +83,7 @@ - With JPEG images, two extras index are returned : + With JPG images, two extras index are returned : channel and bits. channel will be 3 for RGB pictures, and 4 for CMYK pictures. bits is the number of bits for each color. @@ -129,6 +130,50 @@ + + + Image2WBMP + Output image to browser or file + + + Description + + + int image2WBMP + int im + string + filename + + int + threshold + + + + + Image2WBMP creates the + WBMP file in filename from the image + im. The im argument + is the return from the ImageCreate function. + + + The filename argument is optional, and if left off, the raw image + stream will be output directly. + By sending an image/vnd.wap.wbmp content-type + using header, you can create + a PHP script that outputs WBMP images directly. + + + WBMP support is only available in PHP if PHP was compiled + against GD-1.8 or later. + + + + + See also ImageWBMP. + + + + ImageAlphaBlending @@ -1324,6 +1369,12 @@ function LoadWBMP ($imgname) { } + + + WBMP support is only available in PHP if PHP was compiled + against GD-1.8 or later. + + @@ -1348,6 +1399,46 @@ function LoadWBMP ($imgname) { + + + ImageCreateFromXBM + Create a new image from file or URL + + + Description + + + int imagecreatefromxbm + string filename + + + + ImageCreateFromXBM returns an image identifier + representing the image obtained from the given filename. + + + + + + + ImageCreateFromXPM + Create a new image from file or URL + + + Description + + + int imagecreatefromxpm + string filename + + + + ImageCreateFromXPM returns an image identifier + representing the image obtained from the given filename. + + + + ImageDashedLine @@ -1759,6 +1850,9 @@ ImagePng($im); string filename + int + foreground + @@ -1781,8 +1875,15 @@ ImagePng($im); - See also ImagePNG, ImageGIF, - ImageJPEG, ImageTypes. + Using the optional foreground + parameter, you can set the foreground color. Use an + identifier obtained from imagecolorallocate. + The default foreground color is black. + + + See also image2WBMP, ImagePNG, + ImageGIF, ImageJPEG, + ImageTypes. @@ -1926,6 +2027,28 @@ ImagePng($im); + + + ImagePaletteCopy + Copy the palette from one image to another + + + Description + + + int imagepalettecopy + resource destination + resource source + + + + imagepalettecopy copies the + palette from the source image + to the destination image. + + + + ImagePolygon @@ -2927,6 +3050,84 @@ if (ImageTypes() & IMG_PNG) { + + + JPEG2WBMP + + Convert JPEG image file to WBMP image file + + + + Description + + + int jpeg2wbmp + string jpegname + string wbmpname + int d_height + int d_width + + + + Converts the jpegname JPEG file + to WBMP format, and saves it as wbmpname. + With the d_height and + d_width you specify the height + and width of the destination image. + + + + + WBMP support is only available in PHP if PHP was compiled + against GD-1.8 or later. + + + + + See also png2wbmp. + + + + + + + PNG2WBMP + + Convert PNG image file to WBMP image file + + + + Description + + + int png2wbmp + string pngname + string wbmpname + int d_height + int d_width + + + + Converts the pngname PNG file + to WBMP format, and saves it as wbmpname. + With the d_height and + d_width you specify the height + and width of the destination image. + + + + + WBMP support is only available in PHP if PHP was compiled + against GD-1.8 or later. + + + + + See also jpeg2wbmp. + + + + read_exif_data