PHP | Imagick getResource() Function Last Updated : 04 Oct, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report The Imagick::getResource() function is an inbuilt function in PHP which is used to get the specified resource's memory usage. Syntax: int Imagick::getResource( int $type ) Parameters: This function accepts a single parameter $type which holds an integer value corresponding to one of RESOURCETYPE constants. We can also pass the constants directly like getResource(imagick::RESOURCETYPE_DISK);.List of all RESOURCETYPE constants is given below: imagick::RESOURCETYPE_UNDEFINED (0)imagick::RESOURCETYPE_AREA (1)imagick::RESOURCETYPE_DISK (2)imagick::RESOURCETYPE_FILE (3)imagick::RESOURCETYPE_MAP (4)imagick::RESOURCETYPE_MEMORY (5)imagick::RESOURCETYPE_THREAD (6) Return Value: This function returns an integer value containing the resource's information.Exceptions: This function throws ImagickException on error.Below given programs illustrate the Imagick::getResource() function in PHP:Program 1: php <?php // Create a new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); //Get the Resource $resource = $imagick->getResource(imagick::RESOURCETYPE_AREA); echo $resource; ?> Output: 981824 Program 2: php <?php // Create a new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); //Get the Resource $resource = $imagick->getResource(imagick::RESOURCETYPE_MAP); echo $resource; ?> Output: 0 Reference: https://www.php.net/manual/en/imagick.getresource.php Comment More infoAdvertise with us Next Article PHP | Imagick getRegistry() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Imagick getResourceLimit() Function The Imagick::getResourceLimit() function is an inbuilt function in PHP which is used to get the specified resource limit. Syntax: int Imagick::getResourceLimit( int $type ) Parameters: This function accepts a single parameter $type which holds an integer value corresponding to one of RESOURCETYPE co 1 min read PHP | Imagick getRegistry() Function The Imagick::getRegistry() function is an inbuilt function in PHP which is used to get the StringRegistry entry for the named key or false if not set. Syntax: string Imagick::getRegistry( string $key ) Parameters: This function accepts a single parameter $key which holds the key. Return Value: This 1 min read PHP | Imagick getSize() Function The Imagick::getSize() function is an inbuilt function in PHP which is used to get the size associated with the imagick object. Syntax: array Imagick::getSize( void ) Parameters: This function doesnât accepts any parameter. Return Value: This function returns an array with the keys "columns" and "ro 1 min read PHP | Imagick getVersion() Function The Imagick::getVersion() function is an inbuilt function in PHP which is used to get the ImageMagick API version. Syntax: array Imagick::getVersion( void ) Parameters: This function does not accept any parameter. Return Value: This function returns the ImageMagick API version. Below programs illust 1 min read PHP | Imagick getImageScene() Function The Imagick::getImageScene() function is an inbuilt function in PHP which is used to get the image scene of an Imagick object. Syntax: int Imagick::getImageScene( void ) Parameters: This function does not accept any parameter. Return Value: This function returns the image scene. Below programs illus 1 min read PHP | Imagick getColorspace() Function The Imagick::getColorspace() function is an inbuilt function in PHP which is used to get the global colorspace value of an image. Syntax: int Imagick::getColorspace( void ) Parameters: This function doesn't accept any parameters. Return Value: This function returns an integer value which can be comp 1 min read Like