PHP Imagick getImageWidth () Function

PHP

Syntax:
int Imagick::getImageWidth (void)
Parameters:this function takes no parameters. 
Returned value:this function returns the width of the image in pixels.Original image
The following program illustrates the Imagick::getImageWidth()function in PHP:
Program: < / strong> < tr>
// require_once (` path / vendor / autoload.php `); 
// Create Imagick object $image = new Imagick ( ` https: / /media.engineerforengineer.org/wp-content/uploads/engineerforengineer-15.png ` );  
// Function for getting the width of the image $width = $image -> getImageWidth();  
// Displays the width of the image in pixels. print_r ( $width ); ?>
Output:
667
Related Articles:
  • PHP | Imagick autoLevelImage() function
  • PHP | Imagick vignetteImage() function
Link: http://php.net/manual/en/imagick.getimagewidth.php



Get Solution for free from DataCamp guru