Syntax:array Imagick::getImageProfiles (string $pattern = "*", bool $include_values = TRUE)
Parameters:This function takes two parameters as above and described below:
- $pattern:specifies a pattern for profile names. Its default value is *, which gets all available profiles.
- $include_values:specifies whether to return only profile names. The default is correct. If FALSE, only profile names will be returned.
Return value:This function returns an array containing picture profiles or only profile names.The following programs illustrate the
Imagick::getImageProfiles() functionin PHP:
Program 1:
// Create a new one imagick object
$imagick
=
new
Imagick (
’ https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-13.png ’
);
// Set image profile
$imagick
-> setImageProfile (
’borderColor’
,
’green’
);
$imagick
-> setImageProfile (
’borderWidth’
,
’ 20’
);
// Get picture profiles
$profiles
=
$imagick
-> getImageProfiles();
print
(
"
"
. print_r (
$profiles
, true).
"
"
);
?>
Output:Array ([bordercolor] = > green [borderwidth] = > 20)
Program 2:
// Create a new one imagick object
$imagick
=
new
Imagick (
’ https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-13.png ’
);
// Set image profile
$imagick
-> setImageProfile (
’borderColor’
,
’green’
);
$imagick
-> setImageProfile (
’borderWidth’
,
’ 20’
);
// Get picture profiles without values
$profiles
=
$imagick
-> getImageProfiles (
"*"
, false);
print
(
"
"
. print_r (
$profiles
, true).
"
"
);
?>
Output:Array ([0] = > bordercolor [1] = > borderwidth)
Link:https://www.php.net/manual/en/imagick.getimageprofiles.php