Syntax:string Imagick::getFilename (void)
Parameters:This function takes no parameters.
Exceptions:This function throws an ImagickException on error.
Return value:this function returns a string value on success.The following programs illustrate the
Imagick::getFilename() functionin PHP:
Program 1:
// Create a new imagick object
$imagick
=
new
Imagick();
// Get file name
$name
=
$imagick
-> getFilename();
echo
$name
;
?>
Output:It will return an empty string which is the default filename.
Program 2:
// Create a new imagick object
$imagick
=
new
Imagick (
’ https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-13.png ’
);
// Set file name
$imagick
-> setFilename (
’myimage.png’
);
// Get file name
$name
=
$imagick
-> getFilename();
echo
$name
;
?>
Output:myimage.png
Link: https: / /www.php.net/manual/en/imagick.getfilename.php