Friday, July 24, 2026
HomeLanguagesPHP | Gmagick getimageprofile() Function

PHP | Gmagick getimageprofile() Function

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
  
// Create a new Gmagick object
$gmagick = new Gmagick('neveropen.png');
  
// Set the image profile
$gmagick->setimageprofile('profile_name', 'profile_value');
  
// Get the image profile
$profile = $gmagick->getimageprofile("profile_name");
echo $profile;
?>


Output:

profile_value

Program 2:




<?php
  
// Create a new Gmagick object
$gmagick = new Gmagick('neveropen.png');
  
// Set the blur using image profile 
$gmagick->setImageProfile('blur', '10'); 
    
// Use the image profile 
$gmagick->blurimage($gmagick->getImageProfile('blur'), 9); 
    
// Display the image 
header("Content-Type: image/png"); 
echo $gmagick->getImageBlob(); 
?> 


Output:

Reference: https://www.php.net/manual/en/gmagick.getimageprofile.php

RELATED ARTICLES

2 COMMENTS

Most Popular

Dominic
32520 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6902 POSTS0 COMMENTS
Nicole Veronica
12017 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12115 POSTS0 COMMENTS
Shaida Kate Naidoo
7023 POSTS0 COMMENTS
Ted Musemwa
7265 POSTS0 COMMENTS
Thapelo Manthata
6980 POSTS0 COMMENTS
Umr Jansen
6971 POSTS0 COMMENTS