PHP | Gmagick getimageprofile() Function
Last Updated :
21 Jan, 2020
The Gmagick::getimageprofile() function is an inbuilt function in PHP which is used to get the named image profile.
Syntax:
string Gmagick::getimageprofile( string $name )
Parameters: This function accepts a single parameter $name which holds the name of the profile.
Return Value: This function returns a string value containing the value of profile.
Exceptions: This function throws GmagickException on error.
Below given programs illustrate the Gmagick::getimageprofile() function in PHP:
Used Image:
Program 1:
<?php
$gmagick = new Gmagick( 'geeksforgeeks.png' );
$gmagick ->setimageprofile( 'profile_name' , 'profile_value' );
$profile = $gmagick ->getimageprofile( "profile_name" );
echo $profile ;
?>
|
Output:
profile_value
Program 2:
<?php
$gmagick = new Gmagick( 'geeksforgeeks.png' );
$gmagick ->setImageProfile( 'blur' , '10' );
$gmagick ->blurimage( $gmagick ->getImageProfile( 'blur' ), 9);
header( "Content-Type: image/png" );
echo $gmagick ->getImageBlob();
?>
|
Output:
Reference: https://www.php.net/manual/en/gmagick.getimageprofile.php
Share your thoughts in the comments
Please Login to comment...