PHP | Imagick setFormat() Function
Last Updated :
05 Dec, 2019
The Imagick::setFormat() function is an inbuilt function in PHP which is used to set the format of the Imagick object.
Syntax:
bool Imagick::setFormat( string $format )
Parameters: This function accepts a single parameter $format which holds an string value.
Return Value: This function returns TRUE on success.
Below programs illustrate the Imagick::setFormat() function in PHP:
Program 1:
<?php
$imagick = new Imagick(
$imagick ->setFormat( 'png' );
$format = $imagick ->getFormat();
echo $format ;
?>
|
Output:
png
Program 2:
<?php
$imagick = new Imagick(
$imagick ->setFormat( 'jpeg' );
$format = $imagick ->getFormat();
echo $format ;
?>
|
Output:
jpeg
Reference: https://www.php.net/manual/en/imagick.setformat.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...