PHP | Imagick removeImageProfile() Function
Last Updated :
17 Dec, 2019
The Imagick::removeImageProfile() function is an inbuilt function in PHP which is used to remove the named image profile.
Syntax:
string Imagick::removeImageProfile( string $name )
Parameters: This function accepts a single parameter $name which holds the name of the profile.
Return Value: This function returns a string containing the profile.
Exceptions: This function throws ImagickException on error.
Below programs illustrate the Imagick::removeImageProfile() function in PHP:
Program 1:
<?php
$imagick = new Imagick(
$imagick ->setImageProfile( 'name1' , 'profile1' );
$imagick ->setImageProfile( 'name2' , 'profile2' );
$imagick ->removeImageProfile( 'name1' );
$profile = $imagick ->getImageProfiles( '*' );
print ( "<pre>" .print_r( $profile , true). "</pre>" );
?>
|
Output:
Array
(
[name2] => profile2
)
Program 2:
<?php
$imagick = new Imagick(
$imagick ->setImageProfile( 'name1' , 'profile1' );
$imagick ->setImageProfile( 'name2' , 'profile2' );
$imagick ->removeImageProfile( 'name1' );
$imagick ->removeImageProfile( 'name2' );
$profile = $imagick ->getImageProfiles( '*' );
print ( "<pre>" .print_r( $profile , true). "</pre>" );
?>
|
Output:
// Empty array because we removed all the profiles
Array
(
)
Reference: https://www.php.net/manual/en/imagick.removeimageprofile.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...