Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

imagecreatefromgd2part(3) [php man page]

IMAGECREATEFROMGD2PART(3)						 1						 IMAGECREATEFROMGD2PART(3)

imagecreatefromgd2part - Create a new image from a given part of GD2 file or URL

SYNOPSIS
resource imagecreatefromgd2part (string $filename, int $srcX, int $srcY, int $width, int $height) DESCRIPTION
Create a new image from a given part of GD2 file or URL. Tip A URL can be used as a filename with this function if the fopen wrappers have been enabled. See fopen(3) for more details on how to specify the filename. See the "Supported Protocols and Wrappers" for links to information about what abilities the various wrappers have, notes on their usage, and information on any predefined variables they may provide. PARAMETERS
o $filename - Path to the GD2 image. o $srcX - x-coordinate of source point. o $srcY - y-coordinate of source point. o $width -Source width. o $height -Source height. RETURN VALUES
Returns an image resource identifier on success, FALSE on errors. EXAMPLES
Example #1 imagecreatefromgd2part(3) example <?php // For this example we need the image size before $image = getimagesize('./test.gd2'); // Create the image instance now we got the image // sizes $im = imagecreatefromgd2part('./test.gd2', 4, 4, ($image[0] / 2) - 6, ($image[1] / 2) - 6); // Do an image operation, in this case we emboss the // image if PHP 5+ if(function_exists('imagefilter')) { imagefilter($im, IMG_FILTER_EMBOSS); } // Save optimized image imagegd2($im, './test_emboss.gd2'); imagedestroy($im); ?> NOTES
Note This function requires GD 2.0.1 or later (2.0.28 or later is recommended). PHP Documentation Group IMAGECREATEFROMGD2PART(3)

Check Out this Related Man Page

IMAGECREATEFROMWEBP(3)							 1						    IMAGECREATEFROMWEBP(3)

imagecreatefromwebp - Create a new image from file or URL

SYNOPSIS
resource imagecreatefromwebp (string $filename) DESCRIPTION
imagecreatefromwebp(3) returns an image identifier representing the image obtained from the given filename. Tip A URL can be used as a filename with this function if the fopen wrappers have been enabled. See fopen(3) for more details on how to specify the filename. See the "Supported Protocols and Wrappers" for links to information about what abilities the various wrappers have, notes on their usage, and information on any predefined variables they may provide. PARAMETERS
o $filename - Path to the WebP image. RETURN VALUES
Returns an image resource identifier on success, FALSE on errors. EXAMPLES
Example #1 Convert an WebP image to a jpeg image using imagecreatefromwebp(3) <?php // Load the WebP file $im = imagecreatefromwebp('./example.webp'); // Convert it to a jpeg file with 100% quality imagejpeg($im, './example.jpeg', 100); imagedestroy($im); ?> PHP Documentation Group IMAGECREATEFROMWEBP(3)
Man Page

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

GetImageSize() with Unix?

Hello Folks! Problem in getting image size by using getimagesize() function in PHP, the function is working fine on windows OS, but returning nothing on Unix OS, Please guide me how I could get image size/dimensions on Unix OS, as long as I have understood the problem, it is basically the path... (1 Reply)
Discussion started by: mwajhi
1 Replies

2. Linux Benchmarks

Gd2 not compatible with Clientexec

Dear Frnds We are having WHM Cpanel in which many website are their , one of our customer want to install Clientexec software which requires GD2.0.28(compatible) library which is installed. The problem is libpng version which is incompatible with the GD library . Please kindly... (0 Replies)
Discussion started by: naik_mit
0 Replies

3. Linux

Gd2 problem

Dear Frnds We are having WHM Cpanel in which many website are their , one of our customer want to install Clientexec software which requires GD2.0.28(compatible) library which is installed. The problem is libpng version which is incompatible with the GD library . Please kindly help for the... (0 Replies)
Discussion started by: naik_mit
0 Replies

4. Web Development

Fatal Error: Call to undefined function imagefilter()

I am using PHP5 in ubuntu 9.10. First I installed PHP and GD as separate package. I tried doing manipulation with images using php image function. When I try using the function imagefilter(), it was not worked and got the solution that need to compile the PHP with the bundled version of GD. So... (0 Replies)
Discussion started by: skg
0 Replies