diff --git a/functions/image.xml b/functions/image.xml index 8beb2259cd..b0a5ef4624 100644 --- a/functions/image.xml +++ b/functions/image.xml @@ -1,5 +1,5 @@ - + Image functions Image @@ -8,12 +8,18 @@ You can use the image functions in PHP to get the size of JPEG, GIF, - PNG, TIFF and - SWF images, and if + PNG, SWF, + TIFF and JPEG2000 images, and if you have the GD library (available at &url.gd;) you will also be able to create and manipulate images. + + If you have PHP compiled with + you are able to work with information stored in headers of + JPEG and TIFF images. These + functions do not require GD library. + The format of images you are able to manipulate depend on the version of gd you install, and any other libraries gd might need @@ -35,6 +41,52 @@ + + + exif_imagetype + Determine the type of an image. + + + Description + + int|falseexif_thumbnail + stringfilename + + + exif_imagetype reads the first bytes of an image and + checks its signature. When a correct signature is found a constant will be + returned otherwise the return value is &false; The return value is the same + value that GetImageSize returns in index 2 but this + function is much faster. + + + The following constants are defined: + 1 = IMAGETYPE_GIF, 2 = IMAGETYPE_JPG, 3 = IMAGETYPE_PNG, 4 = IMAGETYPE_SWF, + 5 = IMAGETYPE_PSD, 6 = IMAGETYPE_BMP, 7 = IMAGETYPE_TIFF_II (intel byte order), + 8 = IMAGETYPE_TIFF_MM (motorola byte order), 9 = IMAGETYPE_JPC, 10 = IMAGETYPE_JP2, + 11 = IMAGETYPE_JPX. + + + This function can be used to avoid calls to other exif functions with unsupported + file teypes or in conjunction with $_SERVER['HTTP_ACCEPT'] to check whether or + not the viewer is able to see a specific image in his browser. + + + + + This function is only available in PHP 4 compiled using --enable-exif. + + + This function does not require the GD image library. + + + See also GetImageSize. + + + + + + exif_read_data @@ -125,7 +177,7 @@ - <function>read_exif_data</function> example + <function>exif_read_data</function> example ]]> + @@ -195,6 +252,15 @@ COMMENT.2: Comment #3end?> a height/width text string to be used inside a normal HTML. + + + Starting from PHP 4.3 the function can read all embedded IFD + data including arrays (returned as such). Also the size of an embedded thumbnail + is returned in THUMBNAIL subarray and the function + exif_read_data can return thumbnails in TIFF + format. + + This function is only available in PHP 4 compiled using --enable-exif. @@ -221,12 +287,25 @@ COMMENT.2: Comment #3end?> stringexif_thumbnail stringfilename + int&width + int&height exif_thumbnail reads the embedded thumbnail of a TIFF or JPEG image. If the image contains no thumbnail &false; will be returned. + + Both parameters width and height are + available since PHP 4.3 and return the size of the thumbnail. It is possible that + exif_thumbnail cannot create and image but determine the its + size. In this case the return value is false but width and + height are set. + + + Starting from version PHP 4.3 the function exif_thumbnail can + return thumbnails in TIFF format. + @@ -270,8 +349,10 @@ COMMENT.2: Comment #3end?> 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, 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 + PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), + 8 = TIFF(motorola byte order, 9 = JPC, 10 = JP2, 11 = JPX. + Index 3 is a text string with the correct + height="yyy" width="xxx" string that can be used directly in an IMG tag. GetImageSize (file) @@ -330,11 +411,17 @@ COMMENT.2: Comment #3end?> + + TIFF support was added in PHP 4.2. JPEG2000 support will be added + in PHP 4.3. + This function does not require the GD image library. - - + + See also exif_imagetype, exif_read_data + and exif_thumbnail. + URL support was added in PHP 4.0.5